Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 114
Default dynamic range in a macro

Hello,

I am using a set range in numerous macros and I anticpate the size of
the range changing over time, ie ("A1:A10") may become ("A1:A35"). Is
there a way by which I can have the spreadsheet run a check of the
size of certain set of data (row and column numbers), and name the
range so it can be referenced in the macros?

I was thinking of setting the name as "StaffNames" and as more staff
are employed, the size of the range will increase.

The macros simply loop through the range identifying certain criteria
and then carry out an action such as changing background colours or
counting certain occurancies.

I have heard of named ranges but have never set one up. Would a named
range solve the issue I have described and if so, how would I do that?

Matt
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default dynamic range in a macro

You probably want a dynamic named range. That being the case here is a
reference for you...

http://www.cpearson.com/excel/named.htm
--
HTH...

Jim Thomlinson


"MJKelly" wrote:

Hello,

I am using a set range in numerous macros and I anticpate the size of
the range changing over time, ie ("A1:A10") may become ("A1:A35"). Is
there a way by which I can have the spreadsheet run a check of the
size of certain set of data (row and column numbers), and name the
range so it can be referenced in the macros?

I was thinking of setting the name as "StaffNames" and as more staff
are employed, the size of the range will increase.

The macros simply loop through the range identifying certain criteria
and then carry out an action such as changing background colours or
counting certain occurancies.

I have heard of named ranges but have never set one up. Would a named
range solve the issue I have described and if so, how would I do that?

Matt

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
Dynamic Range Name Macro Jonathan Cooper Excel Discussion (Misc queries) 3 March 24th 08 09:04 PM
dynamic range based on criteria, within a dynamic range, passed to a function [email protected] Excel Programming 5 October 9th 07 10:13 PM
creating a dynamic range based on criteria, within a dynamic range, and passing it to a function [email protected] Excel Programming 0 October 9th 07 05:22 PM
Sum on Dynamic Data Range - Macro [email protected] Excel Programming 1 August 26th 05 06:32 AM
Macro to print a dynamic range Russ Excel Programming 3 January 13th 05 05:31 PM


All times are GMT +1. The time now is 06:40 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"