+ Reply to Thread
Results 1 to 5 of 5

vba script for % price change over the period

  1. #1
    Registered User
    Join Date
    08-10-2016
    Location
    Ireland
    MS-Off Ver
    2013
    Posts
    67

    vba script for % price change over the period

    Hi folks,

    I got this vba script from the experts in the thread "New worksheet based on multiple worksheets". This is pulling out the relevant information from the multiple sheets against the unique transactions. Please refer in the sample data attached.

    I wish to add one more in the "output" sheet as % price change over the transactions date. This should come out from the "cost" column in the "transactions" sheet, example: for first transaction "12345678" it should be (4 - 2.14)/2.14 = 87% for the period of 13/01/2020-09/09/2020. Hope I am clear with the need. I have tried to modify the code accordingly but messed it up and couldn't got anything at the end, then thought of reaching out to the experts again. TIA...

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,651

    Re: vba script for % price change over the period

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    08-10-2016
    Location
    Ireland
    MS-Off Ver
    2013
    Posts
    67

    Re: vba script for % price change over the period

    Quote Originally Posted by AlphaFrog View Post
    Please Login or Register  to view this content.
    Thanks AlphaFrog for replying. It is absolutely working fine where the prices have been increased over the time but it is not where the prices have been decreased, example, for item #23456789, the % change should be (21-32)/32 = -34% instead of 52.4%. Please refer in the attached.
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,651

    Re: vba script for % price change over the period

    No need to quote my code.

    Try this...
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    08-10-2016
    Location
    Ireland
    MS-Off Ver
    2013
    Posts
    67

    Re: vba script for % price change over the period

    Thanks man, superb...this is exactly what i need

    Regards,
    Abhi

+ 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. Average sales before price change & after price change
    By michts in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-04-2021, 10:32 AM
  2. Replies: 3
    Last Post: 10-10-2020, 01:14 AM
  3. [SOLVED] Excel 2013 wants to calculate Sales Price , If cost price exits and wants change SP
    By Bitto in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-13-2015, 12:49 PM
  4. Calculate period between multiple dates _VBA script
    By raw_geek in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-07-2014, 08:03 AM
  5. [SOLVED] Compare 1 price against multiple prices and change the price according to a formula
    By CharlieAziz in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 10-16-2012, 11:05 AM
  6. Vba Script That Calculates The Payback Period - Excel
    By FSJ in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-24-2012, 02:05 AM
  7. Replies: 11
    Last Post: 06-25-2009, 04:47 PM

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