ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Message for Ron de Bruin (https://www.excelbanter.com/excel-programming/289463-message-ron-de-bruin.html)

Steph[_3_]

Message for Ron de Bruin
 
Hi Ron. Thanks for the help you have given me on a few questions I
had today. I now need to copy and paste data from several sheets
witin a workbook into a single master sheet. And low and behold, a
Google search on that topic brought me to your tips website!!

I have plagarized the following code from your site:

Sub Consolidate2()

Dim ws As Worksheet
Dim DestSh As Worksheet
Dim shLast As Long
Dim Last As Long

Application.ScreenUpdating = False
Set DestSh = Worksheets("Consolidate")
For Each ws In Worksheets
If ws.Name < DestSh.Name Then
Last = LastRow(DestSh)
shLast = LastRow(sh)
sh.Range(sh.Rows(3), sh.Rows(shLast)).Copy
DestSh.Cells(Last + 1, 1)
End If
Next
Application.ScreenUpdating = True

End Sub

When I run it, I get a "Sub or function not defined" error on the word
LastRow. Did I screw something up?

Thanks again!!

-Steph


All times are GMT +1. The time now is 05:49 AM.

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