Hi all,
I'm trying to make a macro that sorts though a worksheet that is constantly updated with new infomation from another sheet every time its opened.
Workbook 1 - Contains Source DATA (5 Columns)
Workbook 2 - Contains the DATA from Workbook 1 and DATA assoicated with the DATA id's (see below example)
DATA ID DATA DATA DATA DATA DATA DATA DATA DATA ID
The BLUE data must remain in the same postion and not edited. The red data is must be in the same row (See below diagram)
(what i have now)
A **** **** **** **** ****B **** **** **** **** ****
B **** **** **** **** ****A **** **** **** **** ****
(what it should be like)
A **** **** **** **** ****A **** **** **** **** ****
B **** **** **** **** ****B **** **** **** **** ****
the red data must be reordered so that the data id in the red data matches the data id in the blue data.
the macro below is what i have made to check if the data id is in the same row, but if its not it deletes the 4 columns instead of reordering.
Sub REMOVE_ROW_TEXT()
Dim rno As String
Dim LastUsedRow As Long
LastUsedRow = Range("A65000").End(xlUp).Row
LastUsedRow = LastUsedRow + 1
rno = ActiveCell.Row
Do Until Selection.Value = LastUsedRow
If Selection.Value = Selection.Offset(0, 8).Value Then
Selection.Offset(1, 0).Select
Else
'Selection.Range("F2:I2").Delete
Selection.Offset(0, 8).ClearContents
Selection.Offset(0, 7).ClearContents
Selection.Offset(0, 6).ClearContents
Selection.Offset(0, 5).ClearContents
Range("A1").Select
End If
Loop
End Sub
what i would like it to do is to, look at the data ID's in the two columns and match them so that there on the same row, if the data id does not exist in the blue data then the red data gets deleated.
any help with this would be greatly appricated.
ps, i think i made this way to confusing
Bookmarks