![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: May 2002
Posts: 59
|
I have built many macros where I set a loop up to select rows. Since rows are numeric, the statement > Range("A" & Start & ":AQ" & Start).Select < works where Start is the loop counter.
Today I ran into the need to select columns through a loop. I was trying to find how to do it using R1C1 commands, but was unable to. I know about the offset command, but that won't work in my case. I'd appreciate any help anyone can provide. |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Christchurch New Zealand
Posts: 1,030
|
what are you actually trying to do?
|
|
|
|
|
|
#3 |
|
Board Regular
Join Date: May 2002
Posts: 59
|
I'm trying to take the data in columns B to AE, copy it to another sheet (one column at at a time), sort it, delete blank rows, sort it back to original order, and then copy to a new sheet. I want to do a loop where I can select a specific column during each loop.
|
|
|
|
|
|
#4 |
|
Board Regular
Join Date: Apr 2002
Location: Redmond, WA
Posts: 636
|
It is much easier if you use cells() instead of range(). Cells(row number, column number).
|
|
|
|
|
|
#5 |
|
Board Regular
Join Date: May 2002
Posts: 59
|
I've never used cells() before only range().select
I'll look up cells in the help files. Any pointers you can give me in using cells()? Is a valid statement cells(r1c1).select?
__________________
Thanks, Scott |
|
|
|
|
|
#6 |
|
Board Regular
Join Date: May 2002
Posts: 59
|
how do I select B1:B44 using a cells statement? I have only been successful with selecting B1 or B44 -> cells(2,1).select
__________________
Thanks, Scott |
|
|
|
|
|
#7 |
|
Board Regular
Join Date: Mar 2002
Location: England, UK.
Posts: 526
|
Range(Cells(1,2),Cells(44,2)).select
[ This Message was edited by: RET79 on 2002-05-02 15:04 ] |
|
|
|
|
|
#8 |
|
Board Regular
Join Date: May 2002
Posts: 59
|
FANTASTIC! Thanks everyone for your help.
__________________
Thanks, Scott |
|
|
|
|
|
#9 |
|
Board Regular
Join Date: Apr 2002
Location: Redmond, WA
Posts: 636
|
nevermind
[ This Message was edited by: zacemmel on 2002-05-02 15:06 ] |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|