View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike Mike is offline
external usenet poster
 
Posts: 3,101
Default Column letter reference as number reference

The code below will cycle through all the cells in the range you have
described and you can put your code in the middle. AZ equates to 52.

Sub checkcells()
For y = 1 To 57
For x = 1 To 52
check what you want to check for here
Next
Next
End Sub

"mcphc" wrote:

I use the below to get the vertical edge of the print area.

Range("Print_Area").Address

The output of this is something like "$A$:1$AZ$57".

I would like to run a macro that checks each cell in a row from column "A"
to (as in the above) column "AZ"

I would like to use something like

For col = 1 to 52

How do you represent AZ as 52? Or is there a better way of doing this? (I'm
sure there is)