#1
|
|||
|
|||
How to get the if then else statement to work
If (A17 = "512/46000/3B") Then
H17 = "3665.00" Else If (A17 = "302/46000/3B") Then H17 = "4600.00" I am trying to set up a spreadsheet to select the contract in Column A and it automatically fill in the price in column H. I have got this code set up in VBA but I can not figure out to get it to run in Excel automatically. Help! |
#2
|
||||
|
||||
What happens if neither of those results is true?
PS: You don't need VBA for this - it can be done with a simple formula.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
I think a VLOOKUP would be best if there are more than a few contracts.
|
#4
|
|||
|
|||
You can't assign a value to a cell from within a different cell's formula. You CAN assign a forumula to H17 that returns the value you're looking for.
Take a look at the attached file. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Format Switch \* Caps won't work in if..then statement | cwright | Word | 2 | 03-27-2014 04:19 PM |
work of labor vs work of excavator | ketanco | Project | 1 | 02-11-2014 08:53 AM |
Need help with If, Then Statement Please | cangelis | Excel | 4 | 01-03-2014 09:10 AM |
Help with IF Statement | limpbizkit | Excel | 4 | 02-24-2011 09:16 PM |
if statement | piper7971 | PowerPoint | 1 | 08-19-2010 07:10 AM |