+ Reply to Thread
Results 1 to 3 of 3

Macro for a beginner making a mileage tracker

  1. #1
    Registered User
    Join Date
    07-18-2008
    Location
    Canada
    Posts
    5

    Macro for a beginner making a mileage tracker

    I have a simple spreadsheet made for a mileage tracker

    Date Reason kilometers
    today() a pull down list here enter a number


    what I would like is to have a macro button that will fill in the information into another page with the same headings as above (chart). Then every time I enter information and push the macro button - it would put the information on the next line down in the chart. The end result is that every time I enter the values and press the button, it would enter the information on the chart on the next line down until it fills up.

    I hope that I explained this well enough, and look forward to any help possible Thank-you

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,617
    The code below will copy from one sheet to another.
    You would use Data Validation, List for your dropdown list of reasons

    Please Login or Register  to view this content.
    Insert the macro:
    Right click any sheet tab > View Code
    On VB Editor Menubar, select Insert, Module
    Paste the code copied from the window above
    Modify the values assigned to InputCells, OutputSheetName, FirstOutputColumn to reflect your actual workbook values/names
    Close the VBE
    Insert a button from the FORMS Menubar and assign the macro, SaveData to it.
    Suggestion for your list of reasons:
    Put the list on a separate sheet. Select the entire list and type a name, say "REASONS", for it into the Name Box. Finally, select the cell you want the list to appear in, select Data > Validation, Allow List. In the Source box type: "=Reasons"
    Last edited by protonLeah; 07-19-2008 at 02:17 AM.
    Ben Van Johnson

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    You can adapt the contacts form here

    http://www.excel-it.com/vba_examples.htm
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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