Frederikvh
06-17-2014, 01:30 AM
Hey everyone, I'm turning to you all because I can't figure it out myself for the life of me.
I've scoured the forum, but even though my thread title might say otherwise, I can't find anything that can get me where I want to get :)
For the sake of argument, let's say I have a worksheet with 2 columns: column F with numbers in it, column H with text in it.
For example
F H
100 P4
200 P4
800 P2
430 P3
There is no order in how the numbers are defined, and the amount of rows varies from time to time.
What I would to accomplish is the following (in some random mumbo-jumo pseudo-code style thing):
Case H2=P4
case F2<1200
range = yellow background
case F2<800
range = red background
Case H2=P3
case F2<480
range = yellow background
case F2<320
range = red background
Case H2=P2
case F2<240
range = yellow background
case F2<160
range = red background
Case H2=P1
case F2<120
range = yellow background
case F2<60
range = red background
With range, I mean the first cell in that row, untill the last cell in that row that isn't empty.
The first row in the document can be ignored because that's just the column headers.
The above would have to be repeated for each row in the document..
Honestly, I have no idea where to start. I have some experience in coding but this VBA thing seems beyond me :p
Here's to hoping you can point me in the right direction!
Kind regards
I've scoured the forum, but even though my thread title might say otherwise, I can't find anything that can get me where I want to get :)
For the sake of argument, let's say I have a worksheet with 2 columns: column F with numbers in it, column H with text in it.
For example
F H
100 P4
200 P4
800 P2
430 P3
There is no order in how the numbers are defined, and the amount of rows varies from time to time.
What I would to accomplish is the following (in some random mumbo-jumo pseudo-code style thing):
Case H2=P4
case F2<1200
range = yellow background
case F2<800
range = red background
Case H2=P3
case F2<480
range = yellow background
case F2<320
range = red background
Case H2=P2
case F2<240
range = yellow background
case F2<160
range = red background
Case H2=P1
case F2<120
range = yellow background
case F2<60
range = red background
With range, I mean the first cell in that row, untill the last cell in that row that isn't empty.
The first row in the document can be ignored because that's just the column headers.
The above would have to be repeated for each row in the document..
Honestly, I have no idea where to start. I have some experience in coding but this VBA thing seems beyond me :p
Here's to hoping you can point me in the right direction!
Kind regards