+ Reply to Thread
Results 1 to 2 of 2

Changing variable based on a count

  1. #1
    Registered User
    Join Date
    10-10-2014
    Location
    Ireland
    MS-Off Ver
    2013
    Posts
    37

    Changing variable based on a count

    Hi,

    In the code below i am looping through a table finding the rows with particular code (product code) and performing math on another column on that row (units) and adding it to another sheet. The problem i am having is i want the variable 'e20' to be the multiplier 'e202' when a certain number in this case greater than 250 is met. The code below attempts that however if i break this threshold of 250 in the middle of a calculation it does not register that say half of the calculation needs to be at 'e20' and the other at 'e202'. Any advice would be great.

    Thanks,
    SPM

    Please Login or Register  to view this content.
    Last edited by silkpantsman; 10-06-2015 at 05:37 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    08-07-2014
    Location
    Quito, Ecuador
    MS-Off Ver
    Excel 2016 & 365, Windows 10
    Posts
    511

    Re: Changing variable based on a count

    @ silkpantsman

    In your code, on the line:
    Please Login or Register  to view this content.
    I assume that the first time the cell(16,3) was =0, and continue to perform the sum using e20.
    For the second pass, Cells(16, 3)has a value different to 0, so the code skips to the next line:
    Please Login or Register  to view this content.
    If you had not reached to 250 in the first pass, the code stops.

    Sometheing is wrong in your flow diagram for the code
    Barriers are there for those who don't want to dream

+ 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. Replies: 0
    Last Post: 04-08-2015, 04:40 PM
  2. Need formula to count score based on criteria (0/1 variable, time series)
    By wintheranders in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-25-2015, 04:57 AM
  3. [SOLVED] COUNT Function Based on a variable.
    By dwilkinson12 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-19-2014, 02:13 AM
  4. Get count of items based on 4 variable conditions
    By m2som in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 12-18-2013, 01:04 AM
  5. [SOLVED] Change range in formula based on changing row count
    By razz0807 in forum Excel General
    Replies: 6
    Last Post: 04-18-2012, 09:51 AM
  6. Changing cell color based on count
    By mossman65 in forum Excel General
    Replies: 1
    Last Post: 01-28-2011, 09:37 PM
  7. VBA function with changing variable count
    By JordanGoodchild in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-09-2010, 07:07 PM

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