![]() |
Need Check for Blanks formula, please
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 |
Need Check for Blanks formula, please
Sub Carole()
For i = 1 To 5 If IsEmpty(Sheets(i).Range("B1")) Then Else MsgBox ("procesing sheet #" & i) End If Next End Sub -- Gary''s Student - gsnu200718 |
Need Check for Blanks formula, please
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 "Gary''s Student" wrote: Sub Carole() For i = 1 To 5 If IsEmpty(Sheets(i).Range("B1")) Then Else MsgBox ("procesing sheet #" & i) End If Next End Sub -- Gary''s Student - gsnu200718 |
Need Check for Blanks formula, please
You are welcome. Have a pleasant weekend.
-- Gary''s Student - gsnu200718 "Carole O" wrote: 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 "Gary''s Student" wrote: Sub Carole() For i = 1 To 5 If IsEmpty(Sheets(i).Range("B1")) Then Else MsgBox ("procesing sheet #" & i) End If Next End Sub -- Gary''s Student - gsnu200718 |
All times are GMT +1. The time now is 03:46 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com