Changing values in a table

×

×לי

Hi all!

I am asking your help to solve a problem.
I have a general table consisted of 4 columns, and I want to change value in
a cell in one column if a combination of another 2 cells in the same row is
true.

My table looks like that:

A B C D
Capacity Capacity fix Cycle_Num Step_Num
1 10 1
1
2 20 1
1
3 30 1
1
4 40 1
2
5 50 1
2
6 60 1
2
7 70 1
2
1 10 2
1
2 20 2
1
3 30 2
1
4 40 2
2
5 50 2
2
6 60 2
2
7 70 2
2

and my question is: is it possible to change all the 'Capacity' values with
specific "Cycle_Num" and "Step_Num" indexes (for example Cycle_Num = 2 and
Step_Num = 1 ) if the first 'Capacity' value in this range is for example
higher then 2?

Thanks in advance

Eli
 
J

Joel

RowCount = 2
Do while Range("A" & RowCount) <> ""
Capacity = Range("A" & RowCount)
Cycle = Range("C" & RowCount)
Step = Range("D" & RowCount)
if Capacity > 2 and Cycle = 2 and Step = 1 then

'Enter you code here

End if

RowCount = RowCount + 1
loop
 
×

×לי

Many thanks

Joel said:
RowCount = 2
Do while Range("A" & RowCount) <> ""
Capacity = Range("A" & RowCount)
Cycle = Range("C" & RowCount)
Step = Range("D" & RowCount)
if Capacity > 2 and Cycle = 2 and Step = 1 then

'Enter you code here

End if

RowCount = RowCount + 1
loop
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top