Named data into macro

B

Buzz

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
 
L

Lars-Åke Aspelin

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


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
 
P

Per Jessen

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top