Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Can't copy named range

Why will this work.....
Sheets("Configuration").Range("J35:Q35").Copy
Workbooks(HomeBook).Sheets("Report").Range("B" & LastRow)

but not this.....

Sheets("Configuration").Range(MyNamed Range).Copy
Workbooks(HomeBook).Sheets("Report").Range("B" & LastRow)

can't seem to reference a named range in the copy line? Any help
appreciated.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Can't copy named range



" wrote:

Why will this work.....
Sheets("Configuration").Range("J35:Q35").Copy
Workbooks(HomeBook).Sheets("Report").Range("B" & LastRow)

but not this.....

Sheets("Configuration").Range(MyNamed Range).Copy
Workbooks(HomeBook).Sheets("Report").Range("B" & LastRow)

can't seem to reference a named range in the copy line? Any help
appreciated.




Is mynamedrange a variable within the macro or the string name of the range
in the spreadsheet. If it is latter try to type
range("mynameddrange")

if you use this a varaibe use like this
dim mynamedrange as string
set mynamedrange=range("J35:Q35")
then
mynamedrange.copy ..............

try soemthing on thee lines.
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 126
Default Can't copy named range

I think Range("MyNamed Range"), not Range(MyNamed Range), so in my thought

Range("MyNamed Range").Copy
Workbooks(HomeBook).Sheets("Report").Range("B" & LastRow)
or
ActiveWorkbook.Range("MyNamed Range").Copy
Workbooks(HomeBook).Sheets("Report").Range("B" & LastRow)

would work.

keizi

wrote in message
oups.com...
Why will this work.....
Sheets("Configuration").Range("J35:Q35").Copy
Workbooks(HomeBook).Sheets("Report").Range("B" & LastRow)

but not this.....

Sheets("Configuration").Range(MyNamed Range).Copy
Workbooks(HomeBook).Sheets("Report").Range("B" & LastRow)

can't seem to reference a named range in the copy line? Any help
appreciated.


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Can't copy named range



wrote in message
oups.com...
Why will this work.....
Sheets("Configuration").Range("J35:Q35").Copy
Workbooks(HomeBook).Sheets("Report").Range("B" & LastRow)

but not this.....

Sheets("Configuration").Range(MyNamed Range).Copy
Workbooks(HomeBook).Sheets("Report").Range("B" & LastRow)

can't seem to reference a named range in the copy line? Any help
appreciated.


Thanks Venkat,Don & Kounoike you were all right I needed to encase the
named range in speech marks......I was having a bad macro day must stop
eating those fish!

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
Copy cells from named range Melissa Excel Discussion (Misc queries) 2 January 19th 07 08:27 PM
Copy cells from named range Melissa Excel Discussion (Misc queries) 0 January 19th 07 08:15 PM
Sheets named from range, and copy data? [email protected] Excel Discussion (Misc queries) 4 January 12th 07 02:53 PM
copy named range to powerpoint confused Excel Worksheet Functions 1 October 17th 05 03:23 PM
copy named range gav meredith Excel Programming 4 April 28th 04 07:41 AM


All times are GMT +1. The time now is 02:57 PM.

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"