Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Shantanu,
When I got the notification of a reply on this thread I see that my answer was empty except for the auto sign off so here it is again. The following loops through columns until it comes to a cell in row 1 that is blank. You could use a specific column number in lieu of Columns.Count. I am not really sure what it is you want to do but hope the example helps to point you in the right direction. Sub loopThroughColumns() Dim c As Long For c = 1 To Columns.Count If Cells(1, c) < "" Then MsgBox "Cell " & Cells(1, c).Address Else MsgBox "No more data" Exit For End If Next c End Sub -- Regards, OssieMac |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
loop through columns (using for-loop) | Excel Programming | |||
Loop through columns | Excel Programming | |||
Loop through Columns | Excel Programming | |||
loop through columns | Excel Programming | |||
Excel VBA - loop columns named AA, AB..etc | Excel Programming |