Help w/ Visual Basic Marcro Editor

Meat100

n00b
Joined
Apr 19, 2005
Messages
9
Hi, to start I do not know how to use Visual Basic or write macros. Here's my situation, say I have in Column A the numbers 1, 2, 5, 6 in the first 4 cells and in column B the letter u or a blank space in the first 4 cells. Now what I want to do is if say B1 has a u, then divide A1 by 2 and so on. I know I can simply copy Column A's # somewere and put an if than statement in its place referencing the numbers, but the person who asked me to do this doesn't want me hiding columns for some reason.

My question, is there an easy way to do this w/ a macro? so I can just run it and Column As numbers will be divided by 2 if the criteria is met.

Thanks in advance
 
Code:
A               B               C
1               u               =IF($B1="u",$A1/2,"")
2               u               =IF($B2="u",$A2/2,"")
5               u               =IF($B3="u",$A3/2,"")
6               u               =IF($B4="u",$A4/2,"")
Is this what you're after?
Or, can their not be a col. C?


Keep on Folding!! For the [H]orde!!

 
Thanks for replying, yeah thats the problem, he doesn't want a 3rd column. So thats why I asked if there was a simple macro to write in the VBE to just perform those if than statements on a designated column.

I told my co-worker I could do that and hide the column, but he doesn't want to.

Thanks again.
 
Back
Top