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

Help deperately needed...I am trying to create a macro that will do the
following:
Copy the value of cell M4 for each worksheet in a particular workbook and
paste it to a new workbook, BUT the cells should be pasted one cell down
consecutivley in th the destination workbook.

Can anyone help me this?

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 396
Default Macro Workbook Copy Query

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...I am trying to create a macro that will do the
following:
Copy the value of cell M4 for each worksheet in a particular workbook and
paste it to a new workbook, BUT the cells should be pasted one cell down
consecutivley in th the destination workbook.

Can anyone help me this?

Thanks

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

Macro did not work....I have a workbook with many worksheets. However, each
worksheet has is formatted the same. Cell M4 contains a value (2007 revenue
figures) for a company, each company is respectively placed in a worksheet.
The first company is GM, so cell M4 contains GMs 2007 gross revenue amount.
The second company is Crysler, so cell M4 contains Crysler's 2007 gross
revenue amount. There are over 100 companies.

What I want is a macro that will copy the value from cell M4 in each
worksheet from that workbook which contains revenue detail, and paste them to
a new workbook, BUT the values should be entered one cell down in a
consecutive manner in that new (destination) workbook.

Sorry I was not clearer earlier. I appreciate the feedback.

"Wigi" wrote:

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...I am trying to create a macro that will do the
following:
Copy the value of cell M4 for each worksheet in a particular workbook and
paste it to a new workbook, BUT the cells should be pasted one cell down
consecutivley in th the destination workbook.

Can anyone help me this?

Thanks

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 copy query One carla 7 Excel Discussion (Misc queries) 0 July 31st 08 10:55 AM
Macro Copy Workbook Query carla 7 Excel Discussion (Misc queries) 2 July 31st 08 12:58 AM
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
Need a macro to copy a range in one workbook and paste into another workbook Paul Excel Programming 8 July 1st 04 07:42 AM
Using Excel and Query--copy workbook natei6 Excel Programming 1 April 20th 04 01:07 PM


All times are GMT +1. The time now is 10:58 PM.

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"