Forum Home
Press F1
 
Thread ID: 56733 2005-04-13 14:06:00 Help needed with macro in Excel 2003 rolferts (7887) Press F1
Post ID Timestamp Content User
344594 2005-04-13 14:06:00 Hi,
I have a working schema in Excel2003 with a column including information i would like to sort and to get out information from:
Example

A1 8 B1 2
A2 19 B2 2
A3 10 B3
A4 11 B4 2
A5 17 B5
A6 13 B6 2

I would like to make a macro that runs through B column and checks for all "2"s and then will get me back the information located in the A column. Like there is a "2" in B4 and I would like to get back 11(A2)

Thanks

Roffe
rolferts (7887)
344595 2005-04-13 21:52:00 Hi, Im afraid your example doesnt make sense. Do you mean A4 rather than A2 returns 11? So do you want to sum column A where there is a 2 in column B or what. Its unclear what you require. If its merely summing then you dont need a macro. Parry (5696)
344596 2005-04-13 22:41:00 Where do you want your answer returned to Roffe?

You could just copy down an adjacent column the following.

=if($b1=2,$a1,””)

That's if I've got the question right? :confused:

Cheers

Bob
B.M. (505)
1