I hope someone can help with this. I can't find anything on the web to help and everything I have tried fails.
I need to multiply the figures in column L by 50 if the date in column A was before 01/04/2018 otherwise multiply it by 60.
Here is the existing code which I was using prior to 01/04/2018 when I only needed to multiply column L by 50.
Sub test50_HourlyRate()
Application.Calculation = xlCalculationManual
Application.ScreenUpdating = False
Dim Lastrow As Long
With Worksheets("Timemaster data")
Range("R:S").NumberFormat = "£#,##0.00"
Range("R3").Formula = "=L3*50"
Lastrow = .Cells(Rows.Count, "A").End(xlUp).Row
.Range("R3").AutoFill Destination:=.Range("R3:R" & Lastrow) _
, Type:=xlFillDefault
Range("S3").Formula = "=INDEX(Rates!$B:$B,MATCH($B3,Rates!$A:$A,0))*L3"
Lastrow = .Cells(Rows.Count, "A").End(xlUp).Row
.Range("S3").AutoFill Destination:=.Range("S3:S" & Lastrow) _
, Type:=xlFillDefault
End With
Sheets("Timemaster data").Calculate
Sheets("Timemaster data").Activate
Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub
I need to multiply the figures in column L by 50 if the date in column A was before 01/04/2018 otherwise multiply it by 60.
Here is the existing code which I was using prior to 01/04/2018 when I only needed to multiply column L by 50.
Sub test50_HourlyRate()
Application.Calculation = xlCalculationManual
Application.ScreenUpdating = False
Dim Lastrow As Long
With Worksheets("Timemaster data")
Range("R:S").NumberFormat = "£#,##0.00"
Range("R3").Formula = "=L3*50"
Lastrow = .Cells(Rows.Count, "A").End(xlUp).Row
.Range("R3").AutoFill Destination:=.Range("R3:R" & Lastrow) _
, Type:=xlFillDefault
Range("S3").Formula = "=INDEX(Rates!$B:$B,MATCH($B3,Rates!$A:$A,0))*L3"
Lastrow = .Cells(Rows.Count, "A").End(xlUp).Row
.Range("S3").AutoFill Destination:=.Range("S3:S" & Lastrow) _
, Type:=xlFillDefault
End With
Sheets("Timemaster data").Calculate
Sheets("Timemaster data").Activate
Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub