Hi All
This is my first macro code, unfortunately it's taking long time to genereate nearely 8 min.
Need help on this
Sub report()
Dim F1 As String
Dim F2 As String
Dim F3 As String
'Formulas for vlookup
F1 = "=+VLOOKUP(RC[-1], Report Apr 20'!C[-1]:C7,6,0)"
F2 = "=+VLOOKUP(RC[-2],' Report Apr 20'!C[-2]:C7,5,0)"
F3 = "=+VLOOKUP(RC[-3],' Report Apr 20'!C[-3]:C6,4,0)"
Columns("C:E").Select
Selection.Insert Shift:=xlToRight
[C1].Value = "PC / MAG"
[D1].Value = "BU / LOB"
[E1].Value = "BS / BG"
Application.ScreenUpdating = False
Range("c2").Select
Do While IsEmpty(ActiveCell.Offset(0, -1)) = False
ActiveCell.FormulaR1C1 = F1
ActiveCell.Offset(1, 0).Select
Loop
Range("d2").Select
Do While IsEmpty(ActiveCell.Offset(0, -1)) = False
ActiveCell.FormulaR1C1 = F2
ActiveCell.Offset(1, 0).Select
Loop
Range("E2").Select
Do While IsEmpty(ActiveCell.Offset(0, -1)) = False
ActiveCell.FormulaR1C1 = F3
ActiveCell.Offset(1, 0).Select
Loop
Bookmarks