ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Lastrow - function not defined (https://www.excelbanter.com/excel-discussion-misc-queries/197974-lastrow-function-not-defined.html)

seed

Lastrow - function not defined
 
Borrowed this from Ron DeBruin's site but can't get it to work:

Dim SourceRange As Range, DestRange As Range
Dim DestSheet As Worksheet, Lr As Long
Set SourceRange = Sheets("Cart and Time Sheets").Range("l2:x2")
Set DestSheet = Sheets("tests")
Lr = LastRow(DestSheet)

Gets to the Lr line and gives me a sub or function not defined error. I'm
pretty well clueless and any help would be much appreciated.

Wigi

Lastrow - function not defined
 
Did you copy the function LastRow from Ron? It should come in a Module in
your VBA project.


--
Wigi
http://www.wimgielis.be = Excel/VBA, soccer and music


"seed" wrote:

Borrowed this from Ron DeBruin's site but can't get it to work:

Dim SourceRange As Range, DestRange As Range
Dim DestSheet As Worksheet, Lr As Long
Set SourceRange = Sheets("Cart and Time Sheets").Range("l2:x2")
Set DestSheet = Sheets("tests")
Lr = LastRow(DestSheet)

Gets to the Lr line and gives me a sub or function not defined error. I'm
pretty well clueless and any help would be much appreciated.


seed

Lastrow - function not defined
 
Well! Of course not! That clears things up a bit :)

Thanks

"Wigi" wrote:

Did you copy the function LastRow from Ron? It should come in a Module in
your VBA project.


--
Wigi
http://www.wimgielis.be = Excel/VBA, soccer and music


"seed" wrote:

Borrowed this from Ron DeBruin's site but can't get it to work:

Dim SourceRange As Range, DestRange As Range
Dim DestSheet As Worksheet, Lr As Long
Set SourceRange = Sheets("Cart and Time Sheets").Range("l2:x2")
Set DestSheet = Sheets("tests")
Lr = LastRow(DestSheet)

Gets to the Lr line and gives me a sub or function not defined error. I'm
pretty well clueless and any help would be much appreciated.



All times are GMT +1. The time now is 04:15 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com