Dear Experts,
Here is the Attached file and i have create some Code to do this which is incomplete Please made required changes and update the code according to requirements.
Sheet 1 has Data and Sheet2 has result
Here is the Attached file and i have create some Code to do this which is incomplete Please made required changes and update the code according to requirements.
Sheet 1 has Data and Sheet2 has result
Code:
Sub MyVBACODE()
Dim i As Integer
Range("A:A,G:G,I:AG,AI:AZ").EntireColumn.Delete
Columns("A:A").Insert Shift:=xlToRight
For i = 2 To 10000
Cells(i, 1).Value = Cells(i, 4) & ", " & Cells(i, 2) & " " & Cells(i, 3)
Next i
Range("B:D").EntireColumn.Delete
Columns("A:G").Insert Shift:=xlToRight
Range("L:L").Cut Range("A:A")
Range("K:K").Cut Range("D:D")
Range("H:H").Cut Range("E:E")
Range("J:J").Cut Range("F:F")
Range("i:I").Cut Range("G:G")
Range("H2").Select
ActiveCell.FormulaR1C1 = "=YEARFRAC(RC[-2],RC[-4])"
Range("H2").Select
Selection.AutoFill Destination:=Range("H2:H10000")
Range("H2:H10000").Select
ActiveWindow.SmallScroll Down:=-9
Range("H1") = "AGE"
Columns("H:H").Select
Selection.Insert Shift:=xlToRight
Range("H2").Select
ActiveCell.FormulaR1C1 = "=IF(RC[-1]=""Male"",""M"",""F"")"
Range("H2").Select
Selection.AutoFill Destination:=Range("H2:H10000")
Range("H2:H10000").Select
Range("E1") = "Sex"
Range("G:G").Delete
End Sub
Attachments
Last edited: