Microsoft® Excel® based database addin

 

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Tim Guest

    Default 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 that’s it.

    Many many many thanks


  2. #2
    Tim Guest

    Default RE: 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 that’s it.
    >
    > Many many many thanks
    >


Similar Threads

  1. Macro to save and close, then copy file
    By NewSysAdmin in forum Miscellaneous Excel Subjects
    Replies: 2
    Last Post: 12-02-2009, 02:46 PM
  2. How to save a file without overwrite or save a copy?
    By SettingChange in forum Excel Setup
    Replies: 1
    Last Post: 08-05-2009, 07:33 AM
  3. Save column J only using copy/paste & temporary copy
    By mikeburg in forum Programming (VBA, VB, C# etc)
    Replies: 2
    Last Post: 01-29-2009, 02:43 PM
  4. Use a Macro to Save a Copy of a Workbook?
    By Joe D in forum Programming (VBA, VB, C# etc)
    Replies: 3
    Last Post: 01-23-2009, 12:12 AM
  5. Save sheet copy with cell value name using a macro.
    By Leo Rod in forum General Excel Discussion
    Replies: 1
    Last Post: 01-14-2009, 01:04 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts