Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Merge cells from all worksheets into a master worksheet

I am attempting to use the macro as written, from
http://www.rondebruin.nl/copy2.htm. I have tried using the "Copy a range of
each sheet" macro and also the "Copy from row 2 till the last row with data"
macro. Each time I try to run them I get " Compile error:sub or function not
defined" and visual basic is highlighting the following

For Each sh In ThisWorkbook.Worksheets
If sh.Name < DestSh.Name Then
Last = LastRow(DestSh) LastRow is highlighted
shLast = LastRow(sh)

Is there something I need to define?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,123
Default Merge cells from all worksheets into a master worksheet

Hi pmv464

Read good

On top of the page

Important: The macro examples use the functions that you can find in the last section of this page

And above the macro
Note: This example use the function LastRow

Copy the LastRow function also in the standard module

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"pmv464" wrote in message ...
I am attempting to use the macro as written, from
http://www.rondebruin.nl/copy2.htm. I have tried using the "Copy a range of
each sheet" macro and also the "Copy from row 2 till the last row with data"
macro. Each time I try to run them I get " Compile error:sub or function not
defined" and visual basic is highlighting the following

For Each sh In ThisWorkbook.Worksheets
If sh.Name < DestSh.Name Then
Last = LastRow(DestSh) LastRow is highlighted
shLast = LastRow(sh)

Is there something I need to define?

  #3   Report Post  
Posted to microsoft.public.excel.misc
mvk mvk is offline
external usenet poster
 
Posts: 6
Default Merge cells from all worksheets into a master worksheet

You need to enter this code in as well to define the function lastrow. The
code was at the bottom of the page where the code was.

Function LastRow(sh As Worksheet)
On Error Resume Next
LastRow = sh.Cells.Find(What:="*", _
After:=sh.Range("A1"), _
Lookat:=xlPart, _
LookIn:=xlFormulas, _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious, _
MatchCase:=False).Row
On Error GoTo 0
End Function

MVK

"pmv464" wrote in message
...
I am attempting to use the macro as written, from
http://www.rondebruin.nl/copy2.htm. I have tried using the "Copy a range
of
each sheet" macro and also the "Copy from row 2 till the last row with
data"
macro. Each time I try to run them I get " Compile error:sub or function
not
defined" and visual basic is highlighting the following

For Each sh In ThisWorkbook.Worksheets
If sh.Name < DestSh.Name Then
Last = LastRow(DestSh) LastRow is
highlighted
shLast = LastRow(sh)

Is there something I need to define?


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating/Naming New Worksheets Based on Select Cells in Master Worksheet Lilbit Excel Worksheet Functions 2 March 19th 08 05:05 PM
Merge cells to master sheet Steve Excel Discussion (Misc queries) 2 December 13th 07 12:04 AM
merge 3 workbooks (and all coniciding worksheets) into 1 master wb maijiuli Excel Discussion (Misc queries) 0 November 5th 07 05:58 PM
Master Worksheet populated by other Worksheets? Steve Lundwall Excel Worksheet Functions 0 March 3rd 06 01:38 PM
Master Worksheet reflecting sub-worksheets [email protected] New Users to Excel 10 February 25th 06 02:49 AM


All times are GMT +1. The time now is 08:28 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"