I have a with statement that is specific to one cell, I would like to apply it to the column.
This is what I came up with, but where I think I'm having an issue is where I'm using a specific cell for the formula and value.
I'm getting an error I can't have an end with without with. My statement starts with "with".
VBA Code:
With Range("E4")
.Formula = "=IF(C4="""",LEFT(B4,3),LEFT(C4,3))"
.Value = Range("E4")
.HorizontalAlignment = xlLeft
End With
VBA Code:
With Range("E4:E" & Range("B" & Rows.Count).End(xlUp).Row).Select
If Value = """" Then
.Formula = "=LEFT(B4,3)"
.Value = Range("E4")
.HorizontalAlignment = xlLeft
Else
.Formula = "=LEFT(C4,3)"
.Value = Range("E4")
.HorizontalAlignment = xlLeft
End With
End Sub