Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is this Possiblle Using VBA? Loop and highlight based on Sun Criteria?

Status
Not open for further replies.

NewUserMo

Technical User
Mar 15, 2015
23
US
Hello All,

I am not sure if this is possible and I have not been able to find something in the the threads that would help me. My question is the following:

I have 4000 rows of data, one row contains text (column A) and another with numbers (column B) and a third column with text (column C) located in sheet 1 In sheet 2 there is a table that contains a number (total value) the text in sheet 1. We currently take the text and the value in sheet 2 and filter for the text in sheet 1. Starting at the bottom of sheet 1 we manually highlight the cells in column b until the sum is equal to or greater than the value in sheet 2. Once we find identify the cells in sheet 1 that sum to > or equal to s value in sheet 2 we update the sheet 1 column C value to "NO" text. For example:

Sheet 2
A 500

Sheet 1
A 100
A 300
A 1000
A 100
A 500
A 300
A 200
A 100

The code should change the last three rows column C value to NO

Appreciate your help
 
Hi Skip,

Thank you for replying back! The data is sorted with the loudest items on the bottom and the newest on top. So we can not take the 1000. We need to identify the bottom of the list that sum up to > or equal 1000. Also, I am using excel and want to use VBA. Any help you can provide will be greatly appreciated.
 
If every value in column A is "A" then there is no value in those values, so you should just ignore them.

Once you start working with only numbers for math it becomes a relatively easy exercise to loop upwards through the used range, keeping a running totalizer to decide what to do in column C.
 
We cannot take 1000"

Therefore, assuming that the NUMBERS are in column B,

=SUMIF(B:B,"<1000")

If all the values are im column A, why not first PARSE thems into 2 columns via Data > Text to columns > DELIMITED > SPACE
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top