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

Newbie here, please help with the following: I have a workbook with all
worksheets formatted the same. I am in need of a macro that will copy the
value of a cell, say M6, in each M6 cell from the 80 worksheets, and then
paste it to the last sheet in the workbook. However, the cells in the last
worksheet should be pasted one cell down consecutivively.

Greatly appreciate your help
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 896
Default Macro Query

try this macro

Sub kopiuj()

For Each Worksheet In ActiveWorkbook.Worksheets
i = i + 1
If i < ActiveWorkbook.Worksheets.Count Then
Worksheets(i).Range("M6").Copy
Worksheets(ActiveWorkbook.Worksheets.Count).Cells( i, 1).PasteSpecial
Paste:=xlValues
End If
Next

End Sub

pastes values from M6 in any worksheet (but the last one) to the last
one, starting from A1

adjust yr ranges as necessary
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15
Default Macro Query

Thanks for your reply, I am getting a compile error:syntax error message for
line:
Paste:=xlValues. But the macro seems to be the right one except for the
syntax error.
"Jarek Kujawa" wrote:

try this macro

Sub kopiuj()

For Each Worksheet In ActiveWorkbook.Worksheets
i = i + 1
If i < ActiveWorkbook.Worksheets.Count Then
Worksheets(i).Range("M6").Copy
Worksheets(ActiveWorkbook.Worksheets.Count).Cells( i, 1).PasteSpecial
Paste:=xlValues
End If
Next

End Sub

pastes values from M6 in any worksheet (but the last one) to the last
one, starting from A1

adjust yr ranges as necessary

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default Macro Query

try this.

Sub copyeachshtcelltosummary()
ds = Sheets(Sheets.Count).Name
For i = 1 To Sheets.Count - 1
Sheets(i).Range("m6").Copy Sheets(ds).Cells(i, "a")
Next i
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"carla 7" wrote in message
...
Newbie here, please help with the following: I have a workbook with all
worksheets formatted the same. I am in need of a macro that will copy the
value of a cell, say M6, in each M6 cell from the 80 worksheets, and then
paste it to the last sheet in the workbook. However, the cells in the
last
worksheet should be pasted one cell down consecutivively.

Greatly appreciate your help


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

Waw! you guys are amazing....

"Don Guillett" wrote:

try this.

Sub copyeachshtcelltosummary()
ds = Sheets(Sheets.Count).Name
For i = 1 To Sheets.Count - 1
Sheets(i).Range("m6").Copy Sheets(ds).Cells(i, "a")
Next i
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"carla 7" wrote in message
...
Newbie here, please help with the following: I have a workbook with all
worksheets formatted the same. I am in need of a macro that will copy the
value of a cell, say M6, in each M6 cell from the 80 worksheets, and then
paste it to the last sheet in the workbook. However, the cells in the
last
worksheet should be pasted one cell down consecutivively.

Greatly appreciate your help





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


Hello Jarek,

Fast question. Instead of the macro pasting to the values to the last
worksheet vertically, is there anyway it can paste the values horizontally?

Please Help
"Jarek Kujawa" wrote:

try this macro

Sub kopiuj()

For Each Worksheet In ActiveWorkbook.Worksheets
i = i + 1
If i < ActiveWorkbook.Worksheets.Count Then
Worksheets(i).Range("M6").Copy
Worksheets(ActiveWorkbook.Worksheets.Count).Cells( i, 1).PasteSpecial
Paste:=xlValues
End If
Next

End Sub

pastes values from M6 in any worksheet (but the last one) to the last
one, starting from A1

adjust yr ranges as necessary

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 Query shakey1181 Excel Discussion (Misc queries) 3 July 24th 07 07:55 PM
another macro query - deleting a worksheet within a query DavidHawes Excel Discussion (Misc queries) 2 February 26th 07 10:05 AM
Basic Macro Query luvthavodka Excel Discussion (Misc queries) 2 January 4th 07 12:33 AM
NEW WEB QUERY MACRO A.J Setting up and Configuration of Excel 0 July 24th 05 04:31 AM


All times are GMT +1. The time now is 02:20 AM.

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"