Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-29-2014, 01:16 PM
pamed53 pamed53 is offline How to get the if then else statement to work Windows 7 32bit How to get the if then else statement to work Office 2010 32bit
Novice
How to get the if then else statement to work
 
Join Date: Apr 2014
Location: Gainesville GA
Posts: 1
pamed53 is on a distinguished road
Smile 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!
Reply With Quote
  #2  
Old 04-29-2014, 05:05 PM
macropod's Avatar
macropod macropod is offline How to get the if then else statement to work Windows 7 32bit How to get the if then else statement to work Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
  #3  
Old 04-30-2014, 07:42 AM
gebobs gebobs is offline How to get the if then else statement to work Windows 7 64bit How to get the if then else statement to work Office 2010 64bit
Expert
 
Join Date: Mar 2014
Location: Atlanta
Posts: 837
gebobs has a spectacular aura aboutgebobs has a spectacular aura about
Default

I think a VLOOKUP would be best if there are more than a few contracts.
Reply With Quote
  #4  
Old 05-01-2014, 10:12 AM
doni49 doni49 is offline How to get the if then else statement to work Windows 7 64bit How to get the if then else statement to work Office 2010 64bit
Novice
 
Join Date: May 2014
Posts: 2
doni49 is on a distinguished road
Default

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.
Attached Files
File Type: xlsx test.xlsx (12.9 KB, 7 views)
Reply With Quote
Reply



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
How to get the if then else statement to work work of labor vs work of excavator ketanco Project 1 02-11-2014 08:53 AM
How to get the if then else statement to work Need help with If, Then Statement Please cangelis Excel 4 01-03-2014 09:10 AM
How to get the if then else statement to work Help with IF Statement limpbizkit Excel 4 02-24-2011 09:16 PM
How to get the if then else statement to work if statement piper7971 PowerPoint 1 08-19-2010 07:10 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:10 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft