assigning variables

H

Howard

I have a problem that's new to me. I have a column, say B2 through B15.
There aare names in say the first 8 cells. Elsewhere in the code, I do
things with these names; for example I sort these names. Sometimes the
number of names will change. I may have 8 cells with names, and I will need
to change this to 7 cells with names or 9 cells with names. Because the
number of cells with names changes sometimes, and this reference is used in a
number of places in macros and VBA, I would like to assign a variable to the
number of cells, i.e. (variable 'a' = cells B2 thru B9), and then use this
variable insteal of the cell references. This way, if I have to add or
delete a name from the cells, I only have to do it in one place. Any
suggestions?
Thanks, Howard
 

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