OilEconomist
Active Member
- Joined
- Dec 26, 2016
- Messages
- 439
- Office Version
- 2019
- Platform
- Windows
Thanks to all who attempt to assist. Will give feedback on solutions.
Why I am I getting a "Run-time error '1004'. Application-defined or object-defined error on the following line:
For other reasons, I try to do the code like as follows, and get the same type or error:
I am trying to use the least possible lines of code so I would like to avoid using something like this:
I think I just need to modify this properly, but can't find anything on the net.
I did dim i, j, LastRow, and LastColumn all as long.
Once again thanks and any suggestions will be much appreciated.
Why I am I getting a "Run-time error '1004'. Application-defined or object-defined error on the following line:
Code:
Sheets("Template.Line.Item.Data").Range(Cells(2, 13) & Cells(LastRow, i)).Formula = _
"=IFERROR(VLOOKUP( $A2 &"" ""& M$1, Data.Formatted!$E:$U, 3, FALSE), 0)"
For other reasons, I try to do the code like as follows, and get the same type or error:
Code:
Sheets("Template.Line.Item.Data").Range(Cells(2, 13) & Cells(LastRow, LastColumn)).Formula = _
"=IFERROR(VLOOKUP( $A2 &"" ""& M$1, Data.Formatted!$E:$U, 3, FALSE), 0)"
I am trying to use the least possible lines of code so I would like to avoid using something like this:
Code:
ColumnLetter = Split(Cells(1, LastColumn).Address, "$")(1)
I think I just need to modify this properly, but can't find anything on the net.
Code:
Range(Cells(2, 13) & Cells(LastRow, LastColumn))
I did dim i, j, LastRow, and LastColumn all as long.
Once again thanks and any suggestions will be much appreciated.