View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.setup
Gary''s Student
 
Posts: n/a
Default Help with a macro

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

--
Gary''s Student


"peter" wrote:

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