Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro copy query One | Excel Discussion (Misc queries) | |||
Macro Copy Workbook Query | Excel Discussion (Misc queries) | |||
Macro to copy an image (or picture) from one workbook to a new sheetin another workbook | Excel Worksheet Functions | |||
Need a macro to copy a range in one workbook and paste into another workbook | Excel Programming | |||
Using Excel and Query--copy workbook | Excel Programming |