Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Determine Column
I need to loop through all the rows in a spreadsheet and load the data into
various columns in a table. How do I refer to each column in each row without hard coding the row number? For instance, in each row I loop through I want to save off column A into a variable. I need to know how to code that. Thanks. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Determine Column
for i = 1 to 10
var = cells(i,"A").Value Next -- Regards, Tom Ogilvy "csbennett" wrote in message ... I need to loop through all the rows in a spreadsheet and load the data into various columns in a table. How do I refer to each column in each row without hard coding the row number? For instance, in each row I loop through I want to save off column A into a variable. I need to know how to code that. Thanks. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Determine Column
iLastRow = Cells(Rows.Count,"A").End(xlUp),Row For i = 1 to iLastRow myVar = Cells(i,"A").Value Next i This is incomplete, as I assume you will do something with myVar, but hopefully it will get you started. -- HTH Bob Phillips "csbennett" wrote in message ... I need to loop through all the rows in a spreadsheet and load the data into various columns in a table. How do I refer to each column in each row without hard coding the row number? For instance, in each row I loop through I want to save off column A into a variable. I need to know how to code that. Thanks. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Determine Column
Thank you. That helps!
"Bob Phillips" wrote: iLastRow = Cells(Rows.Count,"A").End(xlUp),Row For i = 1 to iLastRow myVar = Cells(i,"A").Value Next i This is incomplete, as I assume you will do something with myVar, but hopefully it will get you started. -- HTH Bob Phillips "csbennett" wrote in message ... I need to loop through all the rows in a spreadsheet and load the data into various columns in a table. How do I refer to each column in each row without hard coding the row number? For instance, in each row I loop through I want to save off column A into a variable. I need to know how to code that. Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Determine a result of one column based on conditions in two column | Excel Discussion (Misc queries) | |||
Determine if column contains duplicate value | Excel Discussion (Misc queries) | |||
Determine if Value in column A exists in Column B | Excel Discussion (Misc queries) | |||
Determine start column/ end column of Merged Cell | Excel Programming | |||
Automatically Determine last row and column | Excel Programming |