Hi,
I am trying to write below formula in VBA code. Can someone please help me?
=IF(LEFT(C2,1)="4",("4 we "&RIGHT(C2,8)),"""YTD")
I tried below code but receiving Compile Error, Syntax error
I am trying to write below formula in VBA code. Can someone please help me?
=IF(LEFT(C2,1)="4",("4 we "&RIGHT(C2,8)),"""YTD")
I tried below code but receiving Compile Error, Syntax error
Sub LeftRight()
Dim r1 As Range, r2 As Range, LResult As String
Set r1 = Range("C1:C12")
Set r2 = Range("B1:B12")
LResult = if(Left(R1, 1)="4","4 we "&RIGHT(C2,8)),"""YTD")
End Sub
Last edited: