Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / March 2008

Tip: Looking for answers? Try searching our database.

Named data into macro

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Buzz - 20 Mar 2008 22:16 GMT
Hello,

I have a named range on one sheet that I want copied to another sheet
when it is Activated

How do I get the macro to enter the data from a Named range?

Buzz
Lars-Åke Aspelin - 20 Mar 2008 22:56 GMT
>Hello,
>
[quoted text clipped - 4 lines]
>
>Buzz

Try this procedure:

Sub copy_range_of_data(fromRange As Range, toRange As Range)
 fromRange.Copy
 ActiveSheet.Paste Destination:=toRange
 Application.CutCopyMode = False
End Sub

Hope this helps  / Lars-Åke
Per Jessen - 20 Mar 2008 23:13 GMT
Hi
Put this code in the codesheet for the worksheet you want to copy to and
edit references to suit your needs.

Private Sub Worksheet_Activate()
Sheets("Sheet1").Range("NamedRange").Copy
ActiveSheet.Paste Destination:=Range("A1")
End Sub

Regards,

Per

> Hello,
>
[quoted text clipped - 4 lines]
>
> Buzz
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.