I only want to grab specific cells

G

Gary Phillips

Okay, I've got an Excel document throws a list of items into a listbox. It grabs that item list from another sheet. Here's how it does that:

Range("B1").Select
While ActiveCell.Value <> ""
test2 = ActiveCell.Value
Sheet1.comboShowReports.AddItem test2
Cells(ActiveCell.Row + 1, 2).Select
Wend

It basically loops down through the list until it reaches an empty cell. Easy enough... Except now I want it to loop through based on an additional piece of information. I want it to grab everything whose value equals null in the B column AND whose value equals "ShowReports" in the C column.

How would I go about doing that?
 
T

Tom Ogilvy

Right now your loop stops when column B equals "Null". How is it supposed
to tell when to end now?

--
Regards,
Tom Ogilvy

Gary Phillips said:
Okay, I've got an Excel document throws a list of items into a listbox. It
grabs that item list from another sheet. Here's how it does that:
Range("B1").Select
While ActiveCell.Value <> ""
test2 = ActiveCell.Value
Sheet1.comboShowReports.AddItem test2
Cells(ActiveCell.Row + 1, 2).Select
Wend

It basically loops down through the list until it reaches an empty cell.
Easy enough... Except now I want it to loop through based on an additional
piece of information. I want it to grab everything whose value equals null
in the B column AND whose value equals "ShowReports" in the C column.
 
Top