Need Check for Blanks formula, please

C

Carole O

Excel 2003 SR2

I am combining several worksheets into one. I'm doing this 5 times for 5
alphabetic ranges. Some times I need to combine 4 worksheets, or 5 or 6,
depending if worksheet 5 or 6 have data (if 5 doesn't, 6 will be blank, also).

So - if B1 of Worksheet 5 is blank, I want to jump to the next routine. But
if B1 of Worksheet 5 has data, I want it to process the next instruction,
then go to Worksheet 6 and check B1.

Question - how do I do this?


TIA
CaroleO
 
G

Gary''s Student

Sub Carole()
For i = 1 To 5
If IsEmpty(Sheets(i).Range("B1")) Then
Else
MsgBox ("procesing sheet #" & i)
End If
Next
End Sub
 
C

Carole O

Thank you! I figured out the i = 1 To 5 means the 1st through 5th worksheets
- regardless of what they are named in the tab, so was able to adjust the
formula. The MsgBox was good to test the code, but I eliminated it after it
worked since I'm turning this over to someone else to run.

Thanks again for giving me the clues to make it work - yea!!

CaroleO
 
Top