+ Reply to Thread
Results 1 to 2 of 2

Annual Accounting Worksheet - Mileage Macro Help Required

  1. #1
    Registered User
    Join Date
    04-11-2020
    Location
    London, England
    MS-Off Ver
    Windows 10 64 bit
    Posts
    5

    Annual Accounting Worksheet - Mileage Macro Help Required

    Hi I'm new

    This is a query for an expert Macro writer who understands coding.

    I'm also new to Macro's and need to know how to set up a macro that can calculate at two different percentage ratios over one worksheet. I can link the results with another workpage using formulaes (so don't need help with that).

    I have set up a new accounting spreadsheet and there is a car mileage workbook page, for which I need to enter my daily business and personal mileage. I want the data (daily mileage total entered) to calculate automatically the amount I can claim in government allowances to give a total cost of mileage for any given day. At present, the annual mileage allowance is 0.45 ppm for up to 10,000 miles and 0.25 ppm over 10,000 miles (standard UK flat rate). So when I enter my mileage throughout the year, running the macro, I want the total amount claimable, based on these allowances according to the miles I have entered into the cell, to be accurate whether under or over 10,000 miles. Otherwise, I will have to use a calculator.

    Could someone help me with writing the Macro code , and what I need to do to set up the macro in the first place? From looking at another example of a similar problem using different figures unrelated to mine, but still based on mileage, I worked it out as this (with B6 being the entry cell). Please don't ask me to justify what I have written below. It was just guesstimated but it seems right if the source of the information code was correct, as given to the person with a similar problem to mine.

    =MAX(B6-10000,0)*25+(MAX(B6-10000,0)-MAX(B6-10000,0))*45

    If that is not right (clueless, as I am) could you write the code correctly for me, please? I have no idea what I am doing as I was just following patterns not understanding what I was doing when copying the code. I have no background in VBA or Macros.

    Many thanks
    BG0612
    Last edited by BG0612; 04-11-2020 at 09:22 AM.

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,632

    Re: Annual Accounting Worksheet - Mileage Macro Help Required

    But do you really need a macro?

    Assuming your mileage is written in column B starting form row 2 (1st row reserved for headers) use in X2 (X being your column with allowance)
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    (you wont go over 10 000 first day ) and such a formula in X3 (and then copy down):
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Best Regards,

    Kaper

+ 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. Mileage worksheet help
    By Roger50046 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-06-2018, 12:15 PM
  2. [SOLVED] accounting for mileage in driver productivity?
    By air044 in forum Excel General
    Replies: 1
    Last Post: 04-23-2016, 02:01 AM
  3. Macro required to move row from one worksheet to another based on cell value
    By Nelvis in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-14-2015, 12:39 AM
  4. [SOLVED] Required macro to break the time and insert a new worksheet
    By PRADEEPB270 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-14-2013, 06:13 AM
  5. [SOLVED] Macro required to delete row numbers specified on another worksheet
    By wknigh14 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-02-2013, 04:04 AM
  6. Replies: 5
    Last Post: 10-01-2012, 12:11 PM
  7. Replies: 0
    Last Post: 11-23-2009, 10:41 AM

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