saschmeling
New Member
- Joined
- Jun 27, 2012
- Messages
- 39
Can anyone tell me why this line of code is not working:
I keep getting an application defined or object defined error when I run it.
Here is the entire subroutine:
Basically, it should do the following.
Look at column A
If there is a number in column A
Look at the 0rg 5110 Projections Workbook Column 3
Return the appropriate number.
Open to any and all suggestions.
Thanks,
Code:
ActiveCell.FormulaR1C1 = "=IF(RC[-5]>0,VLOOKUP(RC[-5],'C:\Users\Scott A. Schmeling\Google Drive\HCA Files\Projection Files\Projection Spreadsheets\Org 5110 Projections.xlsx'!Table2[#All],3),"")"
I keep getting an application defined or object defined error when I run it.
Here is the entire subroutine:
Code:
Sub Projections()
Dim LR As Long
Range("g7").Select
ActiveCell.FormulaR1C1 = "=IF(RC[-5]>0,VLOOKUP(RC[-5],'C:\Users\Scott A. Schmeling\Google Drive\HCA Files\Projection Files\Projection Spreadsheets\Org 5110 Projections.xlsx'!Table2[#All],3),"")"
LR = ActiveSheet.UsedRange.Rows.Count
Range("G7").AutoFill Destination:=Range("G7:G" & LR)
Columns("G:G").Select
Selection.NumberFormat = "_(* #,##0_);_(* (#,##0);_(* ""-""??_);_(@_)"
End Sub
Basically, it should do the following.
Look at column A
If there is a number in column A
Look at the 0rg 5110 Projections Workbook Column 3
Return the appropriate number.
Open to any and all suggestions.
Thanks,