K
Ken Loomis
When I run this macro,
Sub addLeadType(leadType As Integer)
Dim totalrows As Integer
Dim typeCol As Integer
typeCol = 11
' The following line generates the error
Range(Cells(1, typeCol)).Value = "Lead Type"
totalrows = ActiveSheet.UsedRange.Rows.count
Range(Cells(2, typeCol), Cells(totalrows, typeCol)).Value = leadType
End Sub
I get a "<Method 'Range' of object '_Global' failed> error at the line
indicated above.
I tried hard coding the "11" in place of typeCol and get the same error.
Can someone tell me what I am doing wrong here?
Thanks,
Ken Loomis
Sub addLeadType(leadType As Integer)
Dim totalrows As Integer
Dim typeCol As Integer
typeCol = 11
' The following line generates the error
Range(Cells(1, typeCol)).Value = "Lead Type"
totalrows = ActiveSheet.UsedRange.Rows.count
Range(Cells(2, typeCol), Cells(totalrows, typeCol)).Value = leadType
End Sub
I get a "<Method 'Range' of object '_Global' failed> error at the line
indicated above.
I tried hard coding the "11" in place of typeCol and get the same error.
Can someone tell me what I am doing wrong here?
Thanks,
Ken Loomis