ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copying cells from one workbook to another with many sheets (https://www.excelbanter.com/excel-programming/423792-copying-cells-one-workbook-another-many-sheets.html)

Memphis

Copying cells from one workbook to another with many sheets
 
I need to bring over from workbook (8500BasicInfo.xls) details found in a Row
1 (A1:M1) and paste the cells onto a different workbook (8500InputForm.xls)
where the destination cells are scattered in different locations throughout
different Sheets. For example I need A1 from 8500BasicInfo.xls to be copied
and pasted on to 8500InputForm.xls Sheet1 Cell B3, and also A2 copied and
pasted onto Sheet2 Cell A1.
I will then need to save the newly copied information as a new workbook.

I will need to repeat this for every row (about 100 rows) in
8500BasicInfo.xls I will be repeating this every month as new cases come up.

Thank you

P.S. If any one here could help me figure out how to automatically save the
newly created workbook by assigning it a file name composed of the
information found on one of the pasted cells (such as account number, this
will save me a bundle of time as well.


NOPIK

Copying cells from one workbook to another with many sheets
 

I will need to repeat this for every row (about 100 rows) in
8500BasicInfo.xls I will be repeating this every month as new cases come up.

Thank you

Use macro recorder. Than, place result in the loop like:
MyRow=1
do while (Cells(Row,MyCell)<"")
MyRow=MyRow+1
loop
P.S. If any one here could help me figure out how to automatically save the

In Worksheet_Change event check Target.Row and Target.Column for
desired cell address. If match, check other cells for validity.
And, finally use ActiveWorkbook.SaveAs Cells(r1,c1)+Cells(r2,c2)+...

Or, do it in Workbook_BeforeSave event.

NOPIK

Copying cells from one workbook to another with many sheets
 
Sorry missed multiple sheets
For each ws in ActiveWorkbook.worksheets
MyRow=1
do while (ws.Cells(Row,MyCell)<"")
'do something with ws.Cells
*MyRow=MyRow+1
loop
next ws


All times are GMT +1. The time now is 12:57 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com