View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
FSt1 FSt1 is offline
external usenet poster
 
Posts: 3,942
Default Moving a range name AND Contents

hi
something like this might work.
note your destination range is larger than your source range?????
Sub MoveNamedRange()
Dim r As Range
Set r = Range("MyRng")
Range("MyRng").Copy Destination:= _
Sheets("Sheet2").Range("D5:F7")
ActiveWorkbook.Names.Add Name:="MyRng", _
RefersTo:=Sheets("Sheet2").Range("D5:F7")
r.ClearContents 'optional
End Sub

Regards
FSt1

"JMay" wrote:

Currently MyRng (a named range) refersto: sheet1 - B2:D4

How can I change that in VBA to sheet2 - D5 (D5:F7)?

I wish to also include the cells B2:D4 values/contents.

How is this done?