+ Reply to Thread
Results 1 to 3 of 3

Minor tweak to VBA code needed

  1. #1
    Registered User
    Join Date
    10-19-2015
    Location
    Greeneville, TN
    MS-Off Ver
    Office 2010
    Posts
    17

    Minor tweak to VBA code needed

    The VBA code for attached looks at ‘Item’ & ‘Qty’ per record on QUOTES sheet. Then in the ‘Formulas’ sheet, it looks up corresponding ‘Price1’, ‘Price2’, ‘Price3’, ‘Price4’ for that item & quantity range and pastes these values in respective columns J-M of QUOTES sheet. [For example, when it looks for the ‘Qty’, it’s looking at a range that the record’s quantity falls within; for instance, ‘66’ of first record does not fall within any quantity break as ‘100’ is the minimum published quantity for the item (‘RP7’) at the ‘Formulas’ sheet, therefore per the code it returns a default value of “(Call for quote)”. For the next record, the quantity is 1250, so it looks at the item (‘TY16’) & determines that the quantity falls under the ‘1000’ quantity break and uses those Price1/2/3/4 values to paste in QUOTES sheet.] What I’m wanting to add to the QUOTES sheet in the ‘DiscCode’ column for each record is the contents of the cell right above the quantity break (the single letter). For any records that are ‘less than minimum’ (like the first record of qty 66, which is less than the lowest quantity break of 100 for that item) or for any item not found in the ‘Formulas’ list (like ‘Custom Calendar’, etc.), the value for ‘DiscCode’ should be blank. So for the first record, it would be blank. For the second record, it would paste letter “D” (because it’s quantity of 1250 gets a price from the ‘1000’ quantity break, and “D” is in the cell right above the ‘1000’ cell). For the third record, it would paste “C” and so on. Thanks for having a look at this and any help you can offer!
    Attached Files Attached Files

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

    Re: Minor tweak to VBA code needed

    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
    10-19-2015
    Location
    Greeneville, TN
    MS-Off Ver
    Office 2010
    Posts
    17

    Re: Minor tweak to VBA code needed

    Awesome, thanks again for your help!

+ 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. vlookup formula tweak needed
    By 10 Dollar Bill in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-05-2015, 01:32 PM
  2. [SOLVED] VBA that needs minor tweak to send to multiple email addresses
    By gillyr7 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-06-2014, 10:56 AM
  3. Code tweak needed: Copy macro not copying formats only values (with getobject)
    By Gti182 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-19-2012, 01:06 PM
  4. [SOLVED] Minor tweak to this macro required to get it just right - how to do it?
    By cronshd in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-29-2012, 03:08 AM
  5. [SOLVED] Color Pivot Field Titles Macro Code Needs Minor Tweak
    By boldcode in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-17-2011, 08:18 AM
  6. minor tweek to merge cell macro needed
    By 12588sam in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 05-11-2011, 05:39 AM
  7. Newby Needs minor tweak on this VBA Macro code for Excel
    By zulfer7 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-21-2006, 12:35 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