using an IF statement from a pull down box

J

Jason

Hi

I am trying to change another cell based upon a pull down box selection and
cant get the IF statement to 'fire' on the second cell.

Is there a way to automatically do this or can you suggest another simple
method?

Any help would be appreciated.
 
T

T. Valko

What kind of "pull down box" are you using? (there are several kinds)

What does: cant get the IF statement to 'fire', mean?

Incorrect result? Error?

Post the formula so we can see if there's problem with it.
 
J

Jason

When I select an item from the pull down box the if statement doesnt not
automatically update the second cell with any results.The IF statement works
when I remove the pulldown box and manually type the result in first cell
otherwise.

I believe in 97 the same wouldnt work as the pulldown box was not considered
a 'change event' ???

Jason
 
R

Rick Rothstein

What IF statement? I guess you missed the part of Biff's message where he
asked you to "post the formula so we can see if there's problem with it."

Also, you keep saying "pull down box", but there is no control with that
name, so we don't know which one of the several controls it might be. Where
is this control located at... the worksheet or a UserForm? If on the
worksheet, which toolbar did you get it from... the Form or the Control
Toolbox toolbar? Hover your cursor over the icon that you used to get the
control... what name appears in the tooltip when it displays (I'm guessing
ComboBox)?
 
S

Shane Devenshire

Hi,

I'll add my voice to this:

1. What is the formula you are using
2. Is the pull down box - a data validations pull down, a Form toolbar pull
down, a Control Toolbox pull down, or a Auto Filter pull down or a VBA form
combo box?
 
J

Jason

My apologies for not including enough information to diagnose.

The drop-down list is created from a range of cells using data validation.

I want to have the drop-down list in C3 and once something is selected, a
corresponding value is shown in D3.

EG:
LSW 1.5

Taken from a separate worksheet where there is a list of abbreviated codes
(LSW, LSW1.5, OSM…etc) which correspond to a value in the next column (1.5,
2.0, 3.5, etc.)

Jason
 
R

Rick Rothstein

You still didn't show us the IF statement you were trying to use (we asked
twice). Had you done so, it would have shown us the actual sheet name your
list of abbreviated codes and their corresponding values are on as well as
the cells they are in; but because you didn't, you will have to convert the
sheet and cell references yourself. I have assumed the following in the
formula (to be placed in D3) below... the worksheet is named Sheet2 and the
the abbreviated codes are in A1 to A3, their corresponding values are in B1
to B3.

D3: =LOOKUP(C3,Sheet2!$A$1:$A$3,Sheet2!$B$1:$B$3)
 
D

Dave Peterson

So you're using data|Validation for the pull-down box.

Is the If statement in an event that fires (worksheet_change) or is that an
=if() function found in a cell on the worksheet?

Since you're using xl97 and data|validation, you may want to read Debra
Dalgleish's notes about the worksheet_change event:
http://www.contextures.com/xlDataVal08.html#Change

If you're using =if() in a formula in a cell, then this does not apply.
 

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