This the bolded row in my code is giving me a (Run-Time error '1004', Application-defined or Object-defined error)
'Set Supplier ID: Added 9/21/06 by lsteffen
Range("B2").Activate
strVal = "=IF(C2=805,7340,IF(C2=7,7741,IF(C2="",10000,0)))"
With Worksheets("COLLINSLOADS")
LastRow = .Range("A" & Rows.Count).End(xlUp).Row
ActiveCell.Value = strVal
.Range("B2:B" & LastRow).FillDown
End With
Range("B:B").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Can someone tell me why? Is strVal to long?? The reason why I didn't put the IF statement in the spreadsheet is because each time this code is executed, a new spreadsheet gets created. I can send full code if needed.
Thanks,
Liz
'Set Supplier ID: Added 9/21/06 by lsteffen
Range("B2").Activate
strVal = "=IF(C2=805,7340,IF(C2=7,7741,IF(C2="",10000,0)))"
With Worksheets("COLLINSLOADS")
LastRow = .Range("A" & Rows.Count).End(xlUp).Row
ActiveCell.Value = strVal
.Range("B2:B" & LastRow).FillDown
End With
Range("B:B").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Can someone tell me why? Is strVal to long?? The reason why I didn't put the IF statement in the spreadsheet is because each time this code is executed, a new spreadsheet gets created. I can send full code if needed.
Thanks,
Liz