Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem getting formula to fill - XL 2000 Help!!!!

Status
Not open for further replies.

AustinMan

Technical User
Feb 26, 2003
40
US
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.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top