ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   vb for nested if with more than 7 statements (https://www.excelbanter.com/excel-programming/410176-vbulletin-nested-if-more-than-7-statements.html)

Kirstie Adam

vb for nested if with more than 7 statements
 
Hi,

I have a nested if with 9 statements, which won't work. I've looked this up
and read i need to convert to code.

Can i please have some help? I know VB for access, but not really done much
with excel.

I have 9 different car types, and each one has a different value.

I just want it to say, after a cell in range B2:B1000 is changed, if that
cell = car type 1, the cell in C2:C2000 changes to the value £100 and if it
changes to car type 2, the cell in column C changes to value £200 etc.....

Thanks,

Kirstie



Stuart Bray

vb for nested if with more than 7 statements
 
Use a vlookup instead of an if.
Put your list of cars and prices on another sheet. Then, in the cell
that needs to change - type:
=vlookup(
You can then use the fx button to guide you through using vlookups.

ryguy7272

vb for nested if with more than 7 statements
 
Take a look at this:
http://www.contextures.com/xlFunctions02.html

If you feel brave look he
http://www.mvps.org/dmcritchie/excel/vlookup.htm


Regards,
Ryan---

--
RyGuy


"Stuart Bray" wrote:

Use a vlookup instead of an if.
Put your list of cars and prices on another sheet. Then, in the cell
that needs to change - type:
=vlookup(
You can then use the fx button to guide you through using vlookups.


excelquery

vb for nested if with more than 7 statements
 
Is me, on another computer in another office!

Got it working with Vlookup (great wee function)

Thanks for your help.

Kirstie Adam


"Kirstie Adam" (nospam) wrote in message
...
Hi,

I have a nested if with 9 statements, which won't work. I've looked this
up and read i need to convert to code.

Can i please have some help? I know VB for access, but not really done
much with excel.

I have 9 different car types, and each one has a different value.

I just want it to say, after a cell in range B2:B1000 is changed, if that
cell = car type 1, the cell in C2:C2000 changes to the value £100 and if
it changes to car type 2, the cell in column C changes to value £200
etc.....

Thanks,

Kirstie




Kirstie Adam

vb for nested if with more than 7 statements
 
took me a while to get it, but worked great, thanks
k

"Stuart Bray" wrote in message
...
Use a vlookup instead of an if.
Put your list of cars and prices on another sheet. Then, in the cell
that needs to change - type:
=vlookup(
You can then use the fx button to guide you through using vlookups.





All times are GMT +1. The time now is 01:46 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com