PDA

View Full Version : Solved: How to loop through the columns???



sankartalam
05-21-2008, 08:38 PM
Hi all,
i want to run the loop through the columns. could anyone help me please.

suppose if i have the columns from A....Z then my loop has to run from A through Z.

Ken Puls
05-21-2008, 08:48 PM
What exactly, are you trying to do?

Each column can be referred to by an index number (i.e. Columns(1) would return column A).

This example loops through each column, selecting it. (Not sure why you would want to do this exactly, but it does illustrate it.)

Dim lCol As Long
For lCol = 1 To 26
ActiveSheet.Columns(lCol).Select
Next lCol

sankartalam
05-21-2008, 10:33 PM
Thanks alot Ken...

The code which you sent to me is my requirement.