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

Can you create a Range in VBA that is available to be referenced in
spreadsheet formulas? In other words, can you create a range in VBA
that shows up when you click Insert - Name - Define?

Thanks,
Brian
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 789
Default Creating Ranges

Hi
Range("A1:B3").Name = "myRange"

will give you myRange visible in the names dialog box.
regards
Paul

On Mar 24, 3:35*pm, Bongard wrote:
Can you create a Range in VBA that is available to be referenced in
spreadsheet formulas? In other words, can you create a range in VBA
that shows up when you click Insert - Name - Define?

Thanks,
Brian


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Creating Ranges

You can add it to an individual sheet or to the workbook as a whole using
one of these constructions...

Worksheets(Sheet1).Names.Add "YourNameForTheRange", "=Sheet1!$C$3:$F$6"

ThisWorkbook.Names.Add "YourNameForTheRange", "=Sheet1!$C$3:$F$6"

The absolute cell references are important.

--
Rick (MVP - Excel)


"Bongard" wrote in message
...
Can you create a Range in VBA that is available to be referenced in
spreadsheet formulas? In other words, can you create a range in VBA
that shows up when you click Insert - Name - Define?

Thanks,
Brian


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
Creating Named Ranges with VBA Barb Reinhardt Excel Programming 5 August 3rd 06 09:48 PM
Creating ranges pmguerra[_8_] Excel Programming 3 June 1st 06 11:18 PM
Creating a Range from two specified Ranges PeterWilliams Excel Programming 1 May 18th 06 11:56 PM
Creating Ranges Rich Cooper Excel Programming 6 June 3rd 04 07:34 PM
Creating Named Ranges in VBA Mark D'Agosta Excel Programming 4 October 4th 03 06:15 AM


All times are GMT +1. The time now is 03:21 PM.

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"