- Joined
- Jun 23, 2007
- Messages
- 2
- Reaction score
- 0
date a b
--------------------------
apr 03 13 4
sept 03 33 2
lets assume the spreadsheet above. (see attached jpeg)
I have programmed a macro to count the numbers of columns and rows.
Next, I want to dynamically name the data ranges according to my header rows. For ex, Apr-03 till Sep 03 as "dates"
How can I do this automatically? For example inorder to name the first column as "dates", i need to select from A2 till the end row.
.Range("a1:A(end_row)").name = " dates"
I have trouble referencing the end_row. Anyone knows how to do this?
ultimately, i want to do something like
For col_1 to col_n
name (a1 to a_end row) as specified in header
end
PS: the reason why i need to name them is because i need to do matrix calculations. e.g. col_1 - col_n
Thanks!
--------------------------
apr 03 13 4
sept 03 33 2
lets assume the spreadsheet above. (see attached jpeg)
I have programmed a macro to count the numbers of columns and rows.
Next, I want to dynamically name the data ranges according to my header rows. For ex, Apr-03 till Sep 03 as "dates"
How can I do this automatically? For example inorder to name the first column as "dates", i need to select from A2 till the end row.
.Range("a1:A(end_row)").name = " dates"
I have trouble referencing the end_row. Anyone knows how to do this?
ultimately, i want to do something like
For col_1 to col_n
name (a1 to a_end row) as specified in header
end
PS: the reason why i need to name them is because i need to do matrix calculations. e.g. col_1 - col_n
Thanks!
Attachments
Last edited: