Hi all, I regularly deal with a list that i need to match up with another (two lists x 4 columns, side by side (one blank column between)). Unfortunately there are always slight differences in the two data sets, so i need to do the match by eye, hence vlookups or any other formulas won't work.
I presently manually select the data (always one row x four columns) in one list and cut/paste up or down into a blank space which is the closest match to the adjacent list.
The upshot is that I select four cells containing data (eg cells F24:I24) and paste to a blank line somewhere above or below (ie target will be column F:G).
I wrote a bit of code that actually does work - as long as you cut the data before you paste it - ie double click in an area with data (source), before you double click in the blank (target), otherwise it crashes.
My mind is just not working at the moment - I cannot see a way to trap the sequence of steps, plus the code is about as clunky as i could possibly write it... Can anyone help me with this?
-------------
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Target.Column <> 6 Then Exit Sub
If Target.Value <> "" Then
Range(ActiveCell, ActiveCell.Offset(0, 4)).Select
Selection.Cut
Exit Sub
End If
If Target.Value = "" Then
ActiveSheet.Paste
Application.CutCopyMode = False
Exit Sub
End If
End Sub
-------------
Much appreciated,
David
I presently manually select the data (always one row x four columns) in one list and cut/paste up or down into a blank space which is the closest match to the adjacent list.
The upshot is that I select four cells containing data (eg cells F24:I24) and paste to a blank line somewhere above or below (ie target will be column F:G).
I wrote a bit of code that actually does work - as long as you cut the data before you paste it - ie double click in an area with data (source), before you double click in the blank (target), otherwise it crashes.
My mind is just not working at the moment - I cannot see a way to trap the sequence of steps, plus the code is about as clunky as i could possibly write it... Can anyone help me with this?
-------------
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Target.Column <> 6 Then Exit Sub
If Target.Value <> "" Then
Range(ActiveCell, ActiveCell.Offset(0, 4)).Select
Selection.Cut
Exit Sub
End If
If Target.Value = "" Then
ActiveSheet.Paste
Application.CutCopyMode = False
Exit Sub
End If
End Sub
-------------
Much appreciated,
David