Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Any suggestion would be of great help. I am doing a macro that will lookup values from another sheet. Here's the scenario, from column B, it will look up data from column A. My report is up to column Z, how can I make a loop that will run from column B up to column Z. What I did is I created a loop for each column, which is quite long. I hope you have a better way in your mind :-) Thanks in Advance! Jerome |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Use cells instead of Range of along with Range.
for ColCount = 1 to 26 cells(1,i).copy next ColCount or for ColCount = 1 to 26 range(cells(1,i),cells(10,i)).copy next ColCount or for ColCount = 1 to 26 Columns(i).copy next ColCount "jhong" wrote: Hi, Any suggestion would be of great help. I am doing a macro that will lookup values from another sheet. Here's the scenario, from column B, it will look up data from column A. My report is up to column Z, how can I make a loop that will run from column B up to column Z. What I did is I created a loop for each column, which is quite long. I hope you have a better way in your mind :-) Thanks in Advance! Jerome |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Thanks for the reply! I'm just a newbie with vba macro, i've tried but i cannot incorporate your suggestion with my code, hope you can take a look with my code and check how can it be done. Private Sub Test() Sheets("Sheet1l").Select Range("B12").Select Do Until Selection.Formula = "" ActiveCell.FormulaR1C1 = "='Sheet1'!RC+'Sheet2'!RC" Selection.Offset(1, 0).Select Loop End Sub I want this macro to run up to column Z, dont know how to do it :-( Thanks in advance!! On Feb 6, 7:21*pm, Joel wrote: Use cells instead of Range of along with Range. for ColCount = 1 to 26 * *cells(1,i).copy next ColCount or for ColCount = 1 to 26 * *range(cells(1,i),cells(10,i)).copy next ColCount or for ColCount = 1 to 26 * *Columns(i).copy next ColCount "jhong" wrote: Hi, Any suggestion would be of great help. I am doing a macro that will lookup values from another sheet. Here's the scenario, from column B, it will look up data from column A. My report is up to column Z, how can I make a loop that will run from column B up to column Z. What I did is I created a loop for each column, which is quite long. I hope you have a better way in your mind :-) Thanks in Advance! Jerome- Hide quoted text - - Show quoted text - |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
First sentence talks about two sheets. Second sentence does not mention two sheets. Third sentence does not mention two sheets and introduces a Report. What are we looking at, and where are we looking at it from??? regards Paul On Feb 6, 9:29*am, jhong wrote: Hi, Any suggestion would be of great help. I am doing a macro that will lookup values from another sheet. Here's the scenario, from column B, it will look up data from column A. My report is up to column Z, how can I make a loop that will run from column B up to column Z. What I did is I created a loop for each column, which is quite long. I hope you have a better way in your mind :-) Thanks in Advance! Jerome |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
loop through columns (using for-loop) | Excel Programming | |||
Loop through Columns | Excel Programming | |||
loop over columns | Excel Discussion (Misc queries) | |||
loop through columns | Excel Programming | |||
Loop 20 columns Help! | Excel Programming |