Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 203
Default Setting a Range

Good day,

I am trying to set a named range automatically. The problem is that the
range varies daily so i thought of using "cntrl/shft *" to select the
range. I treid recording a macro but it gives me the row & column
numbers and i can not use that.
Can somebody help me with this please.

Thanks in advance

Les Stout

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 535
Default Setting a Range

Hi Tempy,

I am trying to set a named range automatically. The problem is that the
range varies daily so i thought of using "cntrl/shft *" to select the
range. I treid recording a macro but it gives me the row & column
numbers and i can not use that.
Can somebody help me with this please.


You might consider defining a dynamic range:

Use e.g. this formula in the Refersto box of the name:

=OFFSET(Sheet1!$A$1,0,0,COUNTA(Sheet1!$A:$A),COUNT A(Sheet1!$1:$1))

The formula will count all entries in Column A to determine the number of
rows and all entries on row 1 to determine the number of columns to use,
starting from cell A1.

If you use defined names a lot, consider downloading the
Name manager (by Charles Williams, Matthew Henson and
myself) from:

www.jkp-ads.com

or

www.bmsltd.ie/mvp

or from:

www.decisionmodels.com/downloads.htm

Regards,

Jan Karel Pieterse
Excel MVP
www.jkp-ads.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 203
Default Setting a Range

Hello Jan, dankie vir jou help, maar ek het a problem want ek is nie a
programerde nie?

I have a problem of putting the code together, could you help me?

Les Stout

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 535
Default Setting a Range

Hi Tempy,

I have a problem of putting the code together, could you help me?


What problem? what I meant to say was to make the name dynamic in Excel
itself, so you needn't use code to do that, in code you can simply
refer to that name.

Regards,

Jan Karel Pieterse
Excel MVP
www.jkp-ads.com

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Setting a Range

Perhaps you are not familiar with Names.

Under the Insert Menu:

Insert=Names=Define

Name: List1
Refersto:
=OFFSET(Sheet1!$A$1,0,0,COUNTA(Sheet1!$A:$A),COUNT A(Sheet1!$1:$1))

Click the add button.

to refer to the range in your code

set rng = Range("List1")

--
Regards,
Tom Ogilvy


"Tempy" wrote in message
...
Hello Jan, dankie vir jou help, maar ek het a problem want ek is nie a
programerde nie?

I have a problem of putting the code together, could you help me?

Les Stout

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 535
Default Setting a Range

Hi Tom,

Perhaps you are not familiar with Names.


Thanks for elaborating.

Regards,

Jan Karel Pieterse
Excel MVP
www.jkp-ads.com

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 203
Default Setting a Range

Thanks Tom,

I really appreciate the help from all of you.

Les Stout

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
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
Excel Addin:Setting the range to the Excel.Range object range prop Rp007 Excel Worksheet Functions 5 November 24th 06 04:30 PM
VBA setting Range Jeff Excel Discussion (Misc queries) 1 December 2nd 05 07:36 PM
range setting Mike Harris Excel Programming 5 November 22nd 03 05:07 AM
Setting a range using VBA [email protected] Excel Programming 4 November 14th 03 05:16 AM
Setting print range using VBA Dave Ramage[_2_] Excel Programming 0 July 29th 03 04:35 PM


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