Select Range based on column name and not A1 notations

T

T.Vidak

Within a macro, instead of selecting the alphanumeric notations for a column
(i.e. C1,E1) can I use the column title (i.e. ID, Last Updated)? I need to
copy the same three columns over and over again from the Master spreadsheet
into multiple spreadsheets but the data is not always in the same
positio/column in the Master. Thanks for your help, T.
 
B

Bob Phillips

You could get the column numbered with

colNo = Application.Match("ID",Rows(1),0)

and use the column number.


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
F

FSt1

hi
i'm confused. you say you copy the same column but that it's not always in
the same position/column????? is the column shifting for some reason?

Regards
FSt1
 
T

T.Vidak

Yes, the master spreadsheet is created by merging information from multiple
sheets together (I have created a macro to do this). Once changes are applied
in the Master I need to split the information back into the 7 sheets. The
original sheets don't always have the same number of columns therefore the
column numbers on the Master keep shifting with every new cycle.
Consequently, the reference numbers for the 2 columns I need to copy into all
7 sheets are shifting. I have created a macro to split the rest of the
information but I can't get around this problem. Thanks, T
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top