Hi
I hope someone can help, I just don't seem to be able to produce a macro that will work for the problem I have.
I have a macro that works great below:-
Sub MergeRows()
Dim LR As Long, Rw As Long
Dim delRNG As Range
ActiveSheet.Copy
Rows(1).WrapText = True
Rows(2).Font.Bold = True
Selection.sort Key1:=Range("AO2"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
LR = Range("A" & Rows.Count).End(xlUp).Row
Set delRNG = Range("A" & LR + 10)
For Rw = LR To 2 Step -1
If Range("AO" & Rw) = Range("AO" & Rw - 1) Then
Range("AT" & Rw - 1) = Range("AT" & Rw) & "/" & Range("AT" & Rw - 1)
Set delRNG = Union(Range("A" & Rw), delRNG)
End If
Next Rw
delRNG.EntireRow.Delete xlShiftUp
ActiveSheet.Name = "Ship List"
Selection.sort Key1:=Range("AT2"), Order1:=xlAscending, Key2:=Range("BB2" _
), Order2:=xlAscending, Key3:=Range("L2"), Order3:=xlAscending, Header _
:=xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
End Sub
Now I need to make some additions to this to make the following changes :-
1. Insert 5 columns at the start, in the header row call these (in this order)
Col A = Service Reference
Col B = Service
Col C = Service Enhancement
Col D = Service Format
Col E = Service Class
2. Every row (with existing data) in the sheet then needs to be populated with the following data:
Col A = 1
Col B = PK1
Col C = blank
Col D = P
Col e = 1st
3. I then need to merge the surname into the first name column so we have first name and last name together (cols P and Q)
4. In Col V I need it to If cell = United Kingdom make the cell blank but If cell = France, change to FR
5. For Col AD (weight) if col V is blank populate 750 but if Col V shows FR then populate 220
Iv'e been searching for answers for days and trying different options but I am completely stuck.
I have attached the raw data example sheet and an example of how the results should look also.
All help is appreciated.
Many thanks
Jon
Bookmarks