Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() 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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro copy query One | Excel Discussion (Misc queries) | |||
Macro Query | Excel Discussion (Misc queries) | |||
another macro query - deleting a worksheet within a query | Excel Discussion (Misc queries) | |||
Basic Macro Query | Excel Discussion (Misc queries) | |||
NEW WEB QUERY MACRO | Setting up and Configuration of Excel |