Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi David;
You can use this: Sub Try() Range("A1").Select ActiveCell.SpecialCells(xlLastCell).Select MyLastColumn = ActiveCell.Column Range("A1").Select For Count = 1 To MyLastColumn If Not ActiveCell = "" Then 'do your stuff here End If ActiveCell.Offset(0, 1).Select Next End Sub Thanks, Greg -----Original Message----- Please help. I have a macro that applies multiple formatting to a column. Now I want to add looping code so that the formatting will be applied to each column in the sheet that has data in the first row for the column; when there is no more data in the first row(when the entire column is blank) I do not want the column to be formatted. How to I progammatically determine the number of non- empty columns in a sheet and then loop through each of these columns? Thank you. . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I make a graph with 2-cycle X 3-cycle log-log graph paper? | Charts and Charting in Excel | |||
How do I keep result from 1 iteration cycle to use in next cycle? | Excel Discussion (Misc queries) | |||
vba code to cycle through each column in a sheet | Excel Programming | |||
excel - macro code to open a protected sheet, enter passowrd, and then protect sheet | Excel Programming | |||
How to cycle through pivot table column labels? | Excel Programming |