user form to copy and paste from source to destination

R

rbekka33

I have 2workbooks - a source data workbook and a destination dat
modelling workbook. Every month I need to copy select columns from on
workbook to the other - the complication is that they are laid ou
differently eg column A (source) needs to be pasted over the older dat
of column J (destination).

Most of the time the copy and paste format doesn't change so i woul
like to have defaults set but have the option to change where to past
to, if the source changes as I have no control over that workbook.

I would also like to do this in one step if the default is true.

Can I have a user form which allows me to select the source columns an
paste into the destination columns through check boxes or drop dow
lists and if so, how would i do this
 
A

Andoni

as a first step use:


Sub Trythis()

Dim UserRange As Range
Dim UserDestination As Range

On Error Resume Next
Set UserRange = Application.InputBox _
(Prompt:="Select you source data Range", _
Title:="Listen to me:", _
Default:=Selection.Address, _
Type:=8)

On Error GoTo 0
If UserRange Is Nothing Then
MsgBox "Bay Bay!"
End
End If
Set UserDestination = Application.InputBox _
(Prompt:="Select you Destination data Range", _
Title:="Listen to me:", _
Default:=Selection.Cells(1).Address, _
Type:=8)

If UserDestination Is Nothing Then
MsgBox "Bay Bay!"
End
End If

UserRange.Copy UserDestination
End Su
 
R

rbekka33

Thanks for this except i think i may need some more instructions on ho
to incorporate the code.

When I create the User form - what do you suggest? Is this meant t
work with check boxes and drop downs?

I am imagining a user form which goes to the source sheet and allow
you to select one of the columns, and then allows you to select th
paste column from the destination.

thank
 
Top