hello,
I 'm really knew to VBA coding, and I was wondering if you guys could help.
So I was wondering if anyone could help me with this code.
I'm trying to make the if statement code for VBA, it can be either sub or function.
ok so I'm trying to make if statement that says; " if active cell background color is RGB (0,176,240), and if cell B2 says "s-1" then copy the number form A2 to C2, if it Says "s-2" copy the number to D and if it says S-3 copy the number do E"
however if the cells are not manually colored than don't copy nothing and just leave it blank. I attached the table on how the results look like. if you guys could help me with this or give me some guidance I would be really thankful. [TABLE="width: 500"]
<tbody>[TR]
[TD]A
[/TD]
[TD]B
[/TD]
[TD]C
[/TD]
[TD]D
[/TD]
[TD]E
[/TD]
[/TR]
[TR]
[TD]#
[/TD]
[TD]"s"
[/TD]
[TD]S-1
[/TD]
[TD]S-2
[/TD]
[TD]S-3
[/TD]
[/TR]
[TR]
[TD]5
[/TD]
[TD]S-1
[/TD]
[TD]5
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]15
[/TD]
[TD]S-3
[/TD]
[TD][/TD]
[TD][/TD]
[TD]15
[/TD]
[/TR]
[TR]
[TD]87
[/TD]
[TD]S-2
[/TD]
[TD][/TD]
[TD]87
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]150
[/TD]
[TD]S-1
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]78
[/TD]
[TD]S-1
[/TD]
[TD]78
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I 'm really knew to VBA coding, and I was wondering if you guys could help.
So I was wondering if anyone could help me with this code.
I'm trying to make the if statement code for VBA, it can be either sub or function.
ok so I'm trying to make if statement that says; " if active cell background color is RGB (0,176,240), and if cell B2 says "s-1" then copy the number form A2 to C2, if it Says "s-2" copy the number to D and if it says S-3 copy the number do E"
however if the cells are not manually colored than don't copy nothing and just leave it blank. I attached the table on how the results look like. if you guys could help me with this or give me some guidance I would be really thankful. [TABLE="width: 500"]
<tbody>[TR]
[TD]A
[/TD]
[TD]B
[/TD]
[TD]C
[/TD]
[TD]D
[/TD]
[TD]E
[/TD]
[/TR]
[TR]
[TD]#
[/TD]
[TD]"s"
[/TD]
[TD]S-1
[/TD]
[TD]S-2
[/TD]
[TD]S-3
[/TD]
[/TR]
[TR]
[TD]5
[/TD]
[TD]S-1
[/TD]
[TD]5
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]15
[/TD]
[TD]S-3
[/TD]
[TD][/TD]
[TD][/TD]
[TD]15
[/TD]
[/TR]
[TR]
[TD]87
[/TD]
[TD]S-2
[/TD]
[TD][/TD]
[TD]87
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]150
[/TD]
[TD]S-1
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]78
[/TD]
[TD]S-1
[/TD]
[TD]78
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]