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

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

(OP)

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

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

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

You do realize that...

A 1000 < A500

Yes?

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

A 1000 < A 500

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

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

Wow, I'm loosing it!

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

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.

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

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.

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

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