Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
How to cut & paste of multiple rows in many workbooks simultanousl
I do data entries in a main workbook set of sheets with a table of jobs
progress status in the rows. Each row is meant for a particular job only. Also I got 4 different Workbooks with many sheets in which some columns are as same data as my sheet of the main work book. I enter the updates all at once (by opening workbooks one by one) by linking particular first cell to main book & dragging it in the columns of a particular sheet. Once my job completed I cut that whole raw and paste it some where down the screen. Question €“ Is it possible make a settings to enter them as well as cut & paste simultaneously in other 4 books? |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
How to cut & paste of multiple rows in many workbooks simultanousl
This can be done with a macro only, as far as I know. I assume that you have
already selected the rows to copy and that the four documents are open. Sub CopySelectionToFourDocuments() ' Copy the four set of lines four times and change the file name and sheet name accordingly. ' ====== Start Copy the line below ======= Selection.Copy Windows("Book2.xls").Activate ' Activate the receiving document Sheets("Sheet2").Select ' Select the proper sheet Application.Goto Reference:="R65536C1" ' Go to the last cell in column A Selection.End(xlUp).Select ' Go up to find the first non-empty cell Cells(Selection.Row + 1, Selection.Column).Select ActiveSheet.Paste ' ====== Stop copy the line above this one ====== End Sub |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
How to cut & paste of multiple rows in many workbooks simultan
Dear Stephane,
As the macro is required for this I could not do it. I am not used macros yet. I may try if you can guide with step by step procedure. Thank you. "Stephane Quenson" wrote: This can be done with a macro only, as far as I know. I assume that you have already selected the rows to copy and that the four documents are open. Sub CopySelectionToFourDocuments() ' Copy the four set of lines four times and change the file name and sheet name accordingly. ' ====== Start Copy the line below ======= Selection.Copy Windows("Book2.xls").Activate ' Activate the receiving document Sheets("Sheet2").Select ' Select the proper sheet Application.Goto Reference:="R65536C1" ' Go to the last cell in column A Selection.End(xlUp).Select ' Go up to find the first non-empty cell Cells(Selection.Row + 1, Selection.Column).Select ActiveSheet.Paste ' ====== Stop copy the line above this one ====== End Sub |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
How to cut & paste of multiple rows in many workbooks simultan
1. Make sure that you have only 1 excel file open, the one with the rows to
copy from. 2. Press Alt-F11 to open the macro editor (or Menu Tools Macro Visual Basic Editor). 3. You should have a left pane called "Project - VBA project", double click on Sheet1 (or the first sheet you see on that pane). The right pane is changing but it should be empty. 4. Copy the whole code of my previous post, starting from the line Sub CopySelectionToFourDocuments(), to the line End Sub 5. Change on the line Window the file name, and replace it with your first file that needs to receive the records. Do the same on the line below and put the sheet name. The macro assumes that column A contains data, and it will use this column to find the first empty row. If you prefer to use another column, just change the text R65536C1 by R65536C2 for column B, R65536C3 for column C etc (only the last digit is changing). 6. Open the document that will receive the records (same name as of step 5). 7. Go back to the main document, select some rows, and press Alt-F8 (or menu Tools Macro Run macros). You should see one macro called CopySelectionToFourDocuments. Select it and click on the button Run. 8. If everything is OK, the selected rows have been copied to the second document, after the last row containing data in column A. 9. Go back to the macro editor, and copy the lines between the ==== three times. Change the file names and sheet names, and eventually column name, using the same recommendations as step 5. If you see an error message or anything strange, let us know! Stephane. |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
How to cut & paste of multiple rows in many workbooks simultan
I have copied the contents below to try with two books, but got syntax error. The text ''name accordingly'' becomes red. "Sub CopySelectionToFourDocuments()" yellow highlighted. Sub CopySelectionToFourDocuments() ' Copy the four set of lines four times and change the file name and sheet name accordingly. ' ====== Start Copy the line below ======= Selection.Copy Windows("Book2.xls").Activate ' Activate the receiving document Sheets("Sheet2").Select ' Select the proper sheet Application.Goto Reference:="R65536C1" ' Go to the last cell in column A Selection.End(xlUp).Select ' Go up to find the first non-empty cell Cells(Selection.Row + 1, Selection.Column).Select ActiveSheet.Paste ' ====== Stop copy the line above this one ====== End Sub Also please note my both files are in 2007 comptability mode "Stephane Quenson" wrote: 1. Make sure that you have only 1 excel file open, the one with the rows to copy from. 2. Press Alt-F11 to open the macro editor (or Menu Tools Macro Visual Basic Editor). 3. You should have a left pane called "Project - VBA project", double click on Sheet1 (or the first sheet you see on that pane). The right pane is changing but it should be empty. 4. Copy the whole code of my previous post, starting from the line Sub CopySelectionToFourDocuments(), to the line End Sub 5. Change on the line Window the file name, and replace it with your first file that needs to receive the records. Do the same on the line below and put the sheet name. The macro assumes that column A contains data, and it will use this column to find the first empty row. If you prefer to use another column, just change the text R65536C1 by R65536C2 for column B, R65536C3 for column C etc (only the last digit is changing). 6. Open the document that will receive the records (same name as of step 5). 7. Go back to the main document, select some rows, and press Alt-F8 (or menu Tools Macro Run macros). You should see one macro called CopySelectionToFourDocuments. Select it and click on the button Run. 8. If everything is OK, the selected rows have been copied to the second document, after the last row containing data in column A. 9. Go back to the macro editor, and copy the lines between the ==== three times. Change the file names and sheet names, and eventually column name, using the same recommendations as step 5. If you see an error message or anything strange, let us know! Stephane. |
#6
Posted to microsoft.public.excel.misc
|
|||
|
|||
How to cut & paste of multiple rows in many workbooks simultan
Sorry, I am not used to this silly forum application that adds line break
when you don't want to. "name accordingly" is not a line of code, it is the continuation of the previous comment. Move it to the previous line and it should work. "Narnimar" wrote: I have copied the contents below to try with two books, but got syntax error. The text ''name accordingly'' becomes red. "Sub CopySelectionToFourDocuments()" yellow highlighted. Sub CopySelectionToFourDocuments() ' Copy the four set of lines four times and change the file name and sheet name accordingly. ' ====== Start Copy the line below ======= Selection.Copy Windows("Book2.xls").Activate ' Activate the receiving document Sheets("Sheet2").Select ' Select the proper sheet Application.Goto Reference:="R65536C1" ' Go to the last cell in column A Selection.End(xlUp).Select ' Go up to find the first non-empty cell Cells(Selection.Row + 1, Selection.Column).Select ActiveSheet.Paste ' ====== Stop copy the line above this one ====== End Sub Also please note my both files are in 2007 comptability mode "Stephane Quenson" wrote: 1. Make sure that you have only 1 excel file open, the one with the rows to copy from. 2. Press Alt-F11 to open the macro editor (or Menu Tools Macro Visual Basic Editor). 3. You should have a left pane called "Project - VBA project", double click on Sheet1 (or the first sheet you see on that pane). The right pane is changing but it should be empty. 4. Copy the whole code of my previous post, starting from the line Sub CopySelectionToFourDocuments(), to the line End Sub 5. Change on the line Window the file name, and replace it with your first file that needs to receive the records. Do the same on the line below and put the sheet name. The macro assumes that column A contains data, and it will use this column to find the first empty row. If you prefer to use another column, just change the text R65536C1 by R65536C2 for column B, R65536C3 for column C etc (only the last digit is changing). 6. Open the document that will receive the records (same name as of step 5). 7. Go back to the main document, select some rows, and press Alt-F8 (or menu Tools Macro Run macros). You should see one macro called CopySelectionToFourDocuments. Select it and click on the button Run. 8. If everything is OK, the selected rows have been copied to the second document, after the last row containing data in column A. 9. Go back to the macro editor, and copy the lines between the ==== three times. Change the file names and sheet names, and eventually column name, using the same recommendations as step 5. If you see an error message or anything strange, let us know! Stephane. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can't Copy and Paste or Paste Special between Excel Workbooks | Excel Discussion (Misc queries) | |||
insert rows and update linked cells in multiple workbooks | Excel Discussion (Misc queries) | |||
Macro to cut/paste from different workbooks | Excel Discussion (Misc queries) | |||
Inserting rows in multiple workbooks | Excel Discussion (Misc queries) | |||
Copy and paste between workbooks | Excel Discussion (Misc queries) |