Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Dynamic range naming in VB6.3 for Excel

I'm trying to get a macro to change the area referred to by a named
range.

The variables would be

The topleft cell which would be a static named range on a worksheet (eg
TOP_LEFT)

The number of rows the range had which would be an input on the
worksheet

The number of columns the range had which would be an input on the
worksheet

The range on the worksheet I would want to change would be NAMEDRANGE

Thanks in advance for any help

Paul

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Dynamic range naming in VB6.3 for Excel

Set rng = Range("TOP_LEFT").Resize(Range("A1").Value,Range(" A2").Value)
rng.Name = "NAMEDRANGE"

assuming that A1 is the number of rows, A2 is columns.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Paul Chapman" wrote in message
oups.com...
I'm trying to get a macro to change the area referred to by a named
range.

The variables would be

The topleft cell which would be a static named range on a worksheet (eg
TOP_LEFT)

The number of rows the range had which would be an input on the
worksheet

The number of columns the range had which would be an input on the
worksheet

The range on the worksheet I would want to change would be NAMEDRANGE

Thanks in advance for any help

Paul



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Dynamic range naming in VB6.3 for Excel

Smashing thankyou very much for your time

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 146
Default Dynamic range naming in VB6.3 for Excel

Paul -

You don't need a macro to do this.

Ctrl+F3 (Define Names Dialog)

Name:
NAMEDRANGE

Refers To:
=OFFSET(Sheet1!TOP_LEFT,0,0,Sheet1!NUMROWS,Sheet1! NUMCOLS)

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

Paul Chapman wrote:

I'm trying to get a macro to change the area referred to by a named
range.

The variables would be

The topleft cell which would be a static named range on a worksheet (eg
TOP_LEFT)

The number of rows the range had which would be an input on the
worksheet

The number of columns the range had which would be an input on the
worksheet

The range on the worksheet I would want to change would be NAMEDRANGE

Thanks in advance for any help

Paul


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 naming of range needed XXL User Excel Worksheet Functions 2 August 3rd 06 08:26 PM
Dynamic naming of worksheets Zyvind Excel Programming 1 December 10th 04 09:04 AM
Dynamic Sheet Tab Naming rpgun[_2_] Excel Programming 0 October 19th 04 12:36 AM
Dynamic Sheet Tab Naming rpgun Excel Programming 1 October 19th 04 12:01 AM
Dynamic Range Naming JMay Excel Programming 4 December 9th 03 11:17 PM


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