Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel VBA-How do I increment columns in VBA?

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/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Excel VBA-How do I increment columns in VBA?

For i = 1 To 4
Columns(i).Select
Next i

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"waveracerr " wrote in 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/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Excel VBA-How do I increment columns in VBA?

try this:

Eg. For i=1 To 4
Range(cells(1,i),cells(1,i)).Select
Next i

cheers
e
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dragging across columns: I want column constant, but row increment CM Excel Worksheet Functions 7 April 30th 23 07:41 PM
How do I increment a column in Excel Legion Man Excel Discussion (Misc queries) 2 February 7th 10 04:10 AM
Why Excel Does not increment by 2 or 3, odd/even numbers? alsaleh Excel Worksheet Functions 6 November 16th 09 02:06 AM
Increment using a button in excel Chuck P. Excel Discussion (Misc queries) 2 July 25th 07 10:06 PM
Excel Increment columns in rows FGM Excel Discussion (Misc queries) 4 January 3rd 05 04:24 PM


All times are GMT +1. The time now is 02:52 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"