Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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
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
Determine a result of one column based on conditions in two column tel703 Excel Discussion (Misc queries) 1 March 25th 10 05:01 PM
Determine if column contains duplicate value ABM Excel Discussion (Misc queries) 1 July 24th 08 08:00 PM
Determine if Value in column A exists in Column B TJKarakowski Excel Discussion (Misc queries) 3 July 19th 05 06:27 PM
Determine start column/ end column of Merged Cell jC! Excel Programming 3 July 8th 04 12:05 PM
Automatically Determine last row and column steve Excel Programming 5 August 21st 03 08:00 PM


All times are GMT +1. The time now is 07:02 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"