PDA

View Full Version : Userform select and copy



teodormircea
01-17-2008, 03:14 AM
Hello

I would like to make an userform to chose a range of values in a sheet and then chose an other sheet from an othe workk bokk and copy the values

Bob Phillips
01-17-2008, 03:31 AM
Why use a form, you could so it with two simple inputboxes


Set src = Application.Inputbox("Select range to copy FROM with mouse",Type:=8)
Set tgt = Application.Inputbox("Select first cell of range to copy TO with mouse",Type:=8)
If Not src Is Nothing And Not tgt Is Nothing Then
src.Copy rgt
End IF

teodormircea
01-17-2008, 03:40 AM
The think id i want to copy this range in an other sheet on an other workbook

Bob Phillips
01-17-2008, 03:46 AM
So, you select the other book in that code.

teodormircea
01-17-2008, 03:58 AM
Is giving me an error

src.Copy rgt Copy method of Ranges Class Failed

teodormircea
01-17-2008, 04:19 AM
It was tgt