Copy a range

  • Thread starter Thread starter PCOR
  • Start date Start date
P

PCOR

Hi
I was given this code to copy from one sheet to another
This will copy the range given to sheet 1 A1
How can I modify this macro to make the destination fully flexible.
Thanks

im mycell As Range
' Worksheets.Add
Set mycell = Application.InputBox(prompt:="Select a range", Type:=8)
mycell.Copy Sheets("Sheet2").Range("A1")
 
try
Sub copyinputrng()
Sheets("sheet7").Range(InputBox("enterrangetocopy")).Copy
End Sub
 
I guess I did not explain myself very well
With the code below I can invoke the macto and tell it where the data is to
come from The destination is always going to be sheet2 A1
I would like to be able to tell the macro what the destination would also be
 
try this

Sub copyinputrng()
Sheets("sheet7").Range(InputBox("enterrangetocopyfrom")).Copy _
Sheets("sheet8").Range(InputBox("enterrangetocopyto"))
End Sub

--
Don Guillett
SalesAid Software
(e-mail address removed)
PCOR said:
I guess I did not explain myself very well
With the code below I can invoke the macto and tell it where the data is to
come from The destination is always going to be sheet2 A1
I would like to be able to tell the macro what the destination would also be
 
Thanks...it works great
Don Guillett said:
try this

Sub copyinputrng()
Sheets("sheet7").Range(InputBox("enterrangetocopyfrom")).Copy _
Sheets("sheet8").Range(InputBox("enterrangetocopyto"))
End Sub

--
Don Guillett
SalesAid Software
(e-mail address removed)
PCOR said:
I guess I did not explain myself very well
With the code below I can invoke the macto and tell it where the data is to
come from The destination is always going to be sheet2 A1
I would like to be able to tell the macro what the destination would
also
 
Back
Top