Help with a macro

  • Thread starter Thread starter peter
  • Start date Start date
P

peter

I am tring to write a macro that opens a sheet and copies cell from it
to my original sheet. The copied cells are in the same place on the
sheet, but the thing is, the name of the sheet changes. I guess what
I'm asking is is there a way to have it prompt me for the name of the
sheet I'm going to copy from?

Thanks,

Peter
 
Try:


Option Explicit

Sub CopyFromPasteTo()

Dim strF As String
Dim strT As String
Dim rngF As Range
Dim rngT As Range

strF = Application.InputBox("Enter from range", Type:=2)
Set rngF = Range(strF)

strT = Application.InputBox("Enter goto range", Type:=2)
Set rngT = Range(strT)

rngF.Copy rngT

End Sub
 
Back
Top