Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15
Default Macro Copy Workbook Query

Help deperately needed! Does anyone know of macro which does the following?
Copy the value from a particular cell in a worksheet, let's say M4, for
every worksheet in that same workbook, and then paste it to a new workbook.
HOWEVER, the cell values from the source workbook should be pasted one cell
consecutively down in the destination workbook.

For example, If cell M4 is $1200 in worksheet"Rangers!" and cell M4 is $900
in worksheet "Cardinal!" and they are in the same workbook, then both of
these values could be pasted in a new workbook, "Sheet1!" in cell B2 = $1200
(from M4 wksheet "Rangers!") and cell B3 = $900 (from M4 wksheet "Cardinal!").

I hope this clarifies the previous post.

Any Help is greatly appreciated!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 396
Default Macro Copy Workbook Query

Hello


Sub simpleloop()

Const sCell As String = "$M$4"

Dim ws As Worksheet
Dim wb As Workbook

Set wb = Application.Workbooks.Add

For Each ws In ThisWorkbook.Worksheets

wb.Sheets(1).Range("B" & Rows.Count).End(xlUp).Offset(1).Value =
ws.Range(sCell).Value

Next

End Sub




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


"carla 7" wrote:

Help deperately needed! Does anyone know of macro which does the following?
Copy the value from a particular cell in a worksheet, let's say M4, for
every worksheet in that same workbook, and then paste it to a new workbook.
HOWEVER, the cell values from the source workbook should be pasted one cell
consecutively down in the destination workbook.

For example, If cell M4 is $1200 in worksheet"Rangers!" and cell M4 is $900
in worksheet "Cardinal!" and they are in the same workbook, then both of
these values could be pasted in a new workbook, "Sheet1!" in cell B2 = $1200
(from M4 wksheet "Rangers!") and cell B3 = $900 (from M4 wksheet "Cardinal!").

I hope this clarifies the previous post.

Any Help is greatly appreciated!

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15
Default Macro Copy Workbook Query

I get a syntax error at: wb.Sheets(1).Range("B" &
Rows.Count).End(xlUp).Offset(1).Value =


"carla 7" wrote:

Help deperately needed! Does anyone know of macro which does the following?
Copy the value from a particular cell in a worksheet, let's say M4, for
every worksheet in that same workbook, and then paste it to a new workbook.
HOWEVER, the cell values from the source workbook should be pasted one cell
consecutively down in the destination workbook.

For example, If cell M4 is $1200 in worksheet"Rangers!" and cell M4 is $900
in worksheet "Cardinal!" and they are in the same workbook, then both of
these values could be pasted in a new workbook, "Sheet1!" in cell B2 = $1200
(from M4 wksheet "Rangers!") and cell B3 = $900 (from M4 wksheet "Cardinal!").

I hope this clarifies the previous post.

Any Help is greatly appreciated!

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
Macro to copy an image (or picture) from one workbook to a new sheetin another workbook Ruchir Excel Worksheet Functions 1 July 25th 08 07:29 AM
Copy workbook, don't copy macro CongroGrey Excel Discussion (Misc queries) 1 June 13th 08 04:56 PM
Macro to Copy From One Workbook To Another [email protected] Excel Discussion (Misc queries) 3 June 25th 07 02:48 AM
How can I copy a macro into another workbook? jbeene New Users to Excel 4 March 15th 07 06:53 PM
Copy macro to another workbook FTM Excel Discussion (Misc queries) 4 September 21st 06 08:48 PM


All times are GMT +1. The time now is 03:56 PM.

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

About Us

"It's about Microsoft Excel"