Hoopsah
11-18-2009, 07:51 AM
Hi (again!!!)
Anyone know why this macro won't run?
Sub Update_Columns()
'
' Update_Columns Macro
' Macro recorded 18/11/2009 by Gerry McNally
'
'
Dim LastRow As Long
With ActiveSheet
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row - 2
Range("H3").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-3],'I:\Customer Connections\Finance\Income\Sundry Invoices\[New Connection Invoices - Master.xls]Sheet1'!R3C5:R65536C8,4,FALSE)"
Range("H3").AutoFill .Range("H3").Resize(LastRow)
Range("I3").Select
ActiveCell.FormulaR1C1 = "=IF(RC[-2]=0,""Paid"",""Not Paid"")"
Range("I3").AutoFill .Range("I3").Resize(LastRow)
Range("I3").Select
End With
End Sub
Again, after the VLOOKUP the cell isreferenced RC[-3] - this points to cell E3
the macro stops at the line
Range("H3").AutoFill .Range("H3").Resize(LastRow)
Thanks for any help
Hoopsah
Anyone know why this macro won't run?
Sub Update_Columns()
'
' Update_Columns Macro
' Macro recorded 18/11/2009 by Gerry McNally
'
'
Dim LastRow As Long
With ActiveSheet
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row - 2
Range("H3").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-3],'I:\Customer Connections\Finance\Income\Sundry Invoices\[New Connection Invoices - Master.xls]Sheet1'!R3C5:R65536C8,4,FALSE)"
Range("H3").AutoFill .Range("H3").Resize(LastRow)
Range("I3").Select
ActiveCell.FormulaR1C1 = "=IF(RC[-2]=0,""Paid"",""Not Paid"")"
Range("I3").AutoFill .Range("I3").Resize(LastRow)
Range("I3").Select
End With
End Sub
Again, after the VLOOKUP the cell isreferenced RC[-3] - this points to cell E3
the macro stops at the line
Range("H3").AutoFill .Range("H3").Resize(LastRow)
Thanks for any help
Hoopsah