+ Reply to Thread
Results 1 to 7 of 7

Creating a Template that posts data to another Sheet

  1. #1
    Registered User
    Join Date
    12-11-2014
    Location
    Philadelphia
    MS-Off Ver
    2010
    Posts
    4

    Lightbulb Creating a Template that posts data to another Sheet

    I would like to create a two sheet workbook. One of the sheets will be a template with built in formulas that calculates percentages. I then want to "post" that information to the second sheet. Each time I enter information on the template sheet, I would like it to insert columns into the second sheet, ultimately creating a database and averages of all the information I "posted" from the template sheet.

    Any help would be appreciated. I know I will probably have to get into Developer and Macros here, so any instruction would also be appreciated.

    Thank you!

  2. #2
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: Creating a Template that posts data to another Sheet

    You certainly need macros to do this.
    Would it be possible to attach your workbook to your thread so we can work on your actual data structure?
    It would assure you a working system based on your needs.
    Regards
    Pierre Leclerc
    _______________________________________________________

    If you like the help you got,
    Click on the STAR "Add reputation" icon at the bottom.

  3. #3
    Registered User
    Join Date
    12-11-2014
    Location
    Philadelphia
    MS-Off Ver
    2010
    Posts
    4

    Re: Creating a Template that posts data to another Sheet

    Thank you.

    I have uploaded a test file similar to the one I will be working with. I've highlighted the areas with some notes about how I want the data to flow. I will be traveling after today, so I may not respond right away if you have any questions, but I will get back to you when I return.

    Thank you again very much!
    Attached Files Attached Files

  4. #4
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: Creating a Template that posts data to another Sheet

    See attached workbook.
    I added a button. You just have to click on it to transfer data to Data sheet.
    It actually copies the whole 2 columns C and D and clears the data in C3, C5 and C15 where I think you'll be entering new data. You may add or adjust your formulas in those columns as you need to.
    I only copy values of those columns. Not the formulas. If you need the formula you can change the pastespecial line of code.
    Hopes this helps
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    12-11-2014
    Location
    Philadelphia
    MS-Off Ver
    2010
    Posts
    4

    Re: Creating a Template that posts data to another Sheet

    Thank you so much - this work's perfectly for what I need.

    Have a great day!

  6. #6
    Registered User
    Join Date
    12-11-2014
    Location
    Philadelphia
    MS-Off Ver
    2010
    Posts
    4

    Re: Creating a Template that posts data to another Sheet

    Pierre,

    I was working with the sheet and added some formulas. I was able to make the formula work for the first data entry I "post" but it does not work for any thereafter.

    Here is the macro code I used to make the first entry work.

    Range("p15:q23").Select
    Range("p23").Activate
    ActiveCell.FormulaR1C1 = "=SUM(R[-8]C:R[-1]C)"
    Range("p15:q23").Select
    Range("q23").Activate
    ActiveCell.FormulaR1C1 = "=SUM(R[-8]C:R[-1]C)"
    Range("q23").Select
    Range("p28").Select
    ActiveCell.FormulaR1C1 = "=+R[-13]C/R25C16"
    Range("p28").Select
    Selection.AutoFill Destination:=Range("p28:p34"), Type:=xlFillDefault
    Range("p28:p34").Select


    It is not working because as I "post" more data, the columns are no longer Q & P. What can I use to replace these with to ensure that all the future data entries have the correct formula?

    Thank you!

  7. #7
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: Creating a Template that posts data to another Sheet

    First, I have to ask you to modify you last post so that your code is enclosed in CODE tags as per rule #3. Here is how to do it:

    Rule #3. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the [#] button at the top of the post window (if you are editing an existing post, press Go Advanced to see the [#] button). The result will appear like this in the post window:

    [ code ]
    your code here ...
    and here ...
    and here
    [ /code ] 'Don't forget to erase the spaces I added after and before the brackets to show you how it looks

    Now about your problem, I'm not sure I follow you. You are adding formulas to column P and Q. Is this done on the Data sheet? In your first workbook, there was only a description in column P. If you added something in column Q, you have to change some of the code to make sure the 2 columns from Template are copied to the proper place.

    Actually, formulas in columns P and Q would not be changed by the macro and they should not need any modification. Unless there is something I don't understand.
    Could you attached your modified workbook so I can take a look and please put some more explanations of what you want to do.
    Regards
    Last edited by p24leclerc; 12-14-2014 at 01:59 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. creating spreadsheets using a template and data sheet
    By anthonette in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-07-2014, 11:11 AM
  2. Creating New sheet using template
    By sridhar_shri03 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-15-2013, 08:37 AM
  3. [SOLVED] Creating a Time elapsed Spread Sheet that records and posts time...
    By swade730 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-24-2013, 07:11 PM
  4. VBA - Creating a new named sheet with a sheet template
    By Glensafro in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-09-2012, 06:49 AM
  5. creating new sheet from template and naming them from list
    By meacho in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-26-2007, 09:49 AM

Tags for this Thread

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1