Incrementing columns

  • Thread starter Thread starter Thomas Krpata
  • Start date Start date
T

Thomas Krpata

I am trying to automate shading of certain columns based
upon a formula.. I can get the cells to increment
but hor do I get the columns to increment..

ie: from like column AU to column AV to column AW, etc

Dim x as integer
Do while x <= 10
GreenShade = (Range("AU" & Range("A" &
x).value).Value - Range("A" & Range("B" & x).value).Value))
Loop
 
Hi Thomas
not quite sure what you're trying to to but to<loop through rows AND
columns you may try something like the following:

sub foo()
Dim row_index as long
Dim col_index as integer
dim ret_value

For row_index = 1 to 10
for col_index = 1 to 5
ret_value = ret_value + cells(row_index,col_index).value
next col_index
next row_index
msgbox ret_value
end sub
 
Back
Top