Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 68
Default assigning variables

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
--
Howard
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default assigning variables


LastRow = Range("B" & rows.count).end(xlup).row
Set MyRange = Range("B2:B" & LastRow)


--
joel
------------------------------------------------------------------------
joel's Profile: http://www.thecodecage.com/forumz/member.php?u=229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=198523

http://www.thecodecage.com/forumz

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
Assigning cell values to variables Tim Excel Discussion (Misc queries) 3 June 11th 09 04:30 PM
Assigning Variables To An array Throughout a loop R Tanner Excel Programming 3 December 17th 08 07:21 PM
Assigning Cell data to VB Variables [email protected] Excel Programming 3 March 29th 07 04:53 AM
Assigning multiple text strings to variables buggy Excel Programming 0 January 5th 06 08:49 PM
Assigning cell address components to variables Conan Kelly Excel Programming 1 June 15th 05 06:05 AM


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