When I run the following macro in Excel (using VBA) I get the run time error 1004 application defined or object defined error. I get the usual debug message and when I click end I actually get the result I want from the formula - anyone know how to avoid getting the run time error?
thanks!
Sub macro10()
Dim Workbook As String
Dim stDocName As String
Dim CurrMo As Range
Set CurrMo = Worksheets("GRO UP RR MAIN ACC").Range("c3 ")
stDocName = "Q:\Cash\Ba nk Charges\2009\Ch ase Downloads\" & CurrMo & "\[grp15131683.xls]"
Worksheets("GRO UP RR MAIN ACC").Activate
Range("c7").Act ivate
'ActiveCell.For mulaR1C1 = "=IF(ISERROR(VL OOKUP(RC[-2],'" & stDocName & "Activity Detail'!R7C1:R1 05C8,4,0))=TRUE ,0,(VLOOKUP(RC[-2],'" & stDocName & "Activity Detail'!R7C1:R1 05C8,4,0)))"
ActiveCell.Form ulaR1C1 = "=VLOOKUP(R C[-2],'" & stDocName & "Activity Detail'!R7C1:R1 05C8,4,0)))"
Macro2
End Sub
thanks!
Sub macro10()
Dim Workbook As String
Dim stDocName As String
Dim CurrMo As Range
Set CurrMo = Worksheets("GRO UP RR MAIN ACC").Range("c3 ")
stDocName = "Q:\Cash\Ba nk Charges\2009\Ch ase Downloads\" & CurrMo & "\[grp15131683.xls]"
Worksheets("GRO UP RR MAIN ACC").Activate
Range("c7").Act ivate
'ActiveCell.For mulaR1C1 = "=IF(ISERROR(VL OOKUP(RC[-2],'" & stDocName & "Activity Detail'!R7C1:R1 05C8,4,0))=TRUE ,0,(VLOOKUP(RC[-2],'" & stDocName & "Activity Detail'!R7C1:R1 05C8,4,0)))"
ActiveCell.Form ulaR1C1 = "=VLOOKUP(R C[-2],'" & stDocName & "Activity Detail'!R7C1:R1 05C8,4,0)))"
Macro2
End Sub