Copy named range contents to activecell position

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi


I have a dynamic named range "Shift1". I would appreciate some code that I
can assign to a button that will copy the contents of the named range to the
active cell position.

TIA
 
Neal,
Named ranges can be available to the entire workbook or they can be
worksheet specific.

If the name is at the workbook level:
Sub Shift1()
ActiveCell.Value = Range("rngShift1").Value
End Sub

If it is worksheet specific, this is prefered:
Sub Shift1()
ActiveCell.Value = Worksheets("Sheet 1").Range("rngShift1").Value
End Sub

Dale Preuss
 
Private Sub CommandButton1_Click()
Range("Shift1").copy Destination:=ActiveCell
End Sub
 

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

Back
Top