Problem with "Lastline" in VBA Excel 200

Solved/Closed
Scream77 - Mar 11, 2010 at 03:39 PM
rizvisa1 Posts 4479 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Mar 11, 2010 at 06:07 PM
Hello,

Let me start off by saying that I'm a VBA noob, and have never worked in it before. Basically, I inherited a spreadsheet which has a macro that allows me to update it. However, upon upgrading my Office software to 2007, I've been having issues. Specifically, the error message reads "Compile error; Can't find project or library", and it highlights the function "Lastline". A sample formula is included below,

Lastline = Cells(Rows.Count, "A").End(xlUp).Row
Range("B9:H9").Copy
Range("B9:B" & Lastline).PasteSpecial xlPasteFormulas

I'm not sure if the upgraded version of Excel 2007 just doesn't have this function anymore, or if I should be doing something on my end.

Any help is greatly appreciated.

1 reply

rizvisa1 Posts 4479 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 767
Mar 11, 2010 at 06:07 PM
try this


Lastline = Cells(Rows.Count, "A").End(xlUp).Row
Range("B9:H9").Copy

Range("B9:B" & Lastline).Select
Selection.PasteSpecial xlPasteFormulas
0