Here is part of my troubled code.
I merged G15:I15 (cells -3) together, Cell Name is G15 - Example
Private Sub Worksheet_Change(ByVal Target As Range)
Dim X As Integer
Dim Y As String
If ActiveCell.Column = 5 Then
For X = 15 To 29
If (Worksheets("Section II"
.Range("E" & X & ""
.Value = ""
Or IsNull(Worksheets("Section II"
.Range("E" & X & ""
.Value) Then
Y = "G" & X
Debug.Print Y
Me.Range(Y).Formula = "=IF(E" & X & "="""","""",VLOOKUP(E&X&"",RevenueCodeList,2,FALSE))"
Debug.Print Worksheets("Section II"
.Range("G" & X & ""
.Value
End If
Next X
End If
End Sub
I am trying to loop and it stops on this line.
On looking at the error highlighted, it recognizes "Me.Range(Y)... vs "Me.Range("G15"
.Formula...
What is going on, I am trying to loop the formula if E15 through E29 is Null or empty.
I merged G15:I15 (cells -3) together, Cell Name is G15 - Example
Private Sub Worksheet_Change(ByVal Target As Range)
Dim X As Integer
Dim Y As String
If ActiveCell.Column = 5 Then
For X = 15 To 29
If (Worksheets("Section II"
Y = "G" & X
Debug.Print Y
Me.Range(Y).Formula = "=IF(E" & X & "="""","""",VLOOKUP(E&X&"",RevenueCodeList,2,FALSE))"
Debug.Print Worksheets("Section II"
End If
Next X
End If
End Sub
I am trying to loop and it stops on this line.
On looking at the error highlighted, it recognizes "Me.Range(Y)... vs "Me.Range("G15"
What is going on, I am trying to loop the formula if E15 through E29 is Null or empty.