ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel VBA-How do I increment columns in VBA? (https://www.excelbanter.com/excel-programming/290434-excel-vba-how-do-i-increment-columns-vba.html)

waveracerr[_5_]

Excel VBA-How do I increment columns in VBA?
 
I want to run a macro that cycles through columns within a For loop.
can do this within a range no problem. How to do it in column
though...I don't know. Any help?

Eg. For i=1 To 4
Range("A" & (i), "BB" & (i)).Select
Next i

How can I have this code cycle through columns? Thanks!

Rya

--
Message posted from http://www.ExcelForum.com


john

Excel VBA-How do I increment columns in VBA?
 
Ryan,

Not sure if this is what you are looking for...

For i = 1 To 10
Cells(1, i).Select
Next i

HTH... John
www.spreadsheetsolutions.com

-----Original Message-----
I want to run a macro that cycles through columns within

a For loop. I
can do this within a range no problem. How to do it in

columns
though...I don't know. Any help?

Eg. For i=1 To 4
Range("A" & (i), "BB" & (i)).Select
Next i

How can I have this code cycle through columns? Thanks!

Ryan


---
Message posted from http://www.ExcelForum.com/

.



All times are GMT +1. The time now is 05:08 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com