Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to copy and populate an egsisting ssheet and save it.
Hi everybody,
I have a spreadsheet (Spreadsheet A) with a table in it having different data like this: Schematic 1 200 210 205 Schematic 2 160 200 300 There are about 300 rows and 20 columns in that table. I also have a second spreadsheet (Spreadsheet B) with a simple schematic in it. What I want to do is: 1: To populate some certain cells in Spreadsheet B (where the schematic is) based on the data of the first row in the table (200, 210, 205€¦€¦) 2: rename and save this spreadsheet (either separately or as a new sheet in the same workbook) with the value/name given in the first cell of the first row. 3: repeat the procedure for the next row. Let me know if smth unclear. Can you also please answer in Macro for dummies as I can record a macro, maybe change some code in it but than thats it. Many many many thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to copy and populate an egsisting ssheet and save it.
Ok, I just experimented with a code which copies the sheet "schematic" in the
same workbook and renames it based on values found in the "Table" spreadsheet. What I want still to do, is to populate certain cells in the newly created sheet with cell values taken from the same row as the name, in the table sheet. Below is the code that I wrote so far: Sub Copy_Sheets() Dim i As Integer Dim wks As Worksheet Set wks = Sheets("Table") For i = 3 To 250 Sheets("Schematic").Copy after:=Sheets(2) ActiveSheet.Name = wks.Cells(i, 1) ActiveSheet.Cells(1, 2) = wks.Cells(i, 1) Next End Sub "Tim" wrote: Hi everybody, I have a spreadsheet (Spreadsheet A) with a table in it having different data like this: Schematic 1 200 210 205 Schematic 2 160 200 300 There are about 300 rows and 20 columns in that table. I also have a second spreadsheet (Spreadsheet B) with a simple schematic in it. What I want to do is: 1: To populate some certain cells in Spreadsheet B (where the schematic is) based on the data of the first row in the table (200, 210, 205€¦€¦) 2: rename and save this spreadsheet (either separately or as a new sheet in the same workbook) with the value/name given in the first cell of the first row. 3: repeat the procedure for the next row. Let me know if smth unclear. Can you also please answer in Macro for dummies as I can record a macro, maybe change some code in it but than thats it. Many many many thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to save and close, then copy file | Excel Discussion (Misc queries) | |||
Using Macro to Save Copy of File to New Location | Excel Discussion (Misc queries) | |||
creat a macro to save a copy with different file name | Excel Discussion (Misc queries) | |||
How to save a file without overwrite or save a copy? | Setting up and Configuration of Excel | |||
Use a Macro to Save a Copy of a Workbook? | Excel Programming |