LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 233
Default Excel Name object bug

All,

I want to add a sheet name referencing a multi area range on another
sheet.

The normal code to do this actually fails:

Sub t()
Dim rngMyRange As Range
Dim shtMysheet As Worksheet
Dim shtMyOthersheet As Worksheet


Set shtMysheet = ActiveWorkbook.Worksheets(1)
Set shtMyOthersheet = ActiveWorkbook.Worksheets(2)
Set rngMyRange = shtMyOthersheet.Range("A1,A3")

shtMysheet.Names.Add "MyName", "=" & rngMyRange.Address(, , , True)
Debug.Print shtMysheet.Names("MyName").RefersTo
shtMysheet.Names("MyName").Delete
End Sub

Only the first area of the range is on the correct sheet. all other
areas are on the sheet of the defined name.

Anybode got some code to get around this?

DM Unseen

 
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
2 Label Options - Forms Object vs Control Box Object Awrex Excel Discussion (Misc queries) 3 July 17th 09 07:10 PM
Option button object proeprties or object not found in vba Pete Straman S via OfficeKB.com Excel Programming 0 August 31st 05 05:49 PM
Confusion about how the Window object fits into the Excel object model Josh Sale Excel Programming 11 April 15th 05 06:08 PM
returning pivottable object from a range object Grant Excel Programming 2 September 27th 04 02:22 AM
Range object to Array object conversion Myrna Larson[_2_] Excel Programming 1 August 1st 03 02:27 AM


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