If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > nested if, or a better way to do it

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-18-07, 13:14
Jay59 Jay59 is offline
Registered User
 
Join Date: Sep 2006
Posts: 162
nested if, or a better way to do it

i have a row with 45 columns on sheet a that reference to a row on sheet b
Its duplicated 40 times sheet a, this way i can change the change the data on sheet b and it will be changed all 40 times.

what i want to so is add a control on sheet a like so.

if cell A1 = 1 then use data from this row on sheet b
if cell A1 = 2 then use data from this row on sheet b
and so on

Should i use a nested if or is there a simpler better way to do this?
Reply With Quote
  #2 (permalink)  
Old 01-18-07, 13:31
RedNeckGeek RedNeckGeek is offline
Village Idiot
 
Join Date: Jul 2003
Location: Michigan
Posts: 1,941
Probably depends on how deep your IF has to go. Is it a choice between 2 values or 30 values?

If it's just 2, use a nested if. If it's a bunch, you may want to use a macro.
__________________
Inspiration Through Fermentation
Reply With Quote
  #3 (permalink)  
Old 01-18-07, 13:54
Jay59 Jay59 is offline
Registered User
 
Join Date: Sep 2006
Posts: 162
its just 3, thanks
Reply With Quote
  #4 (permalink)  
Old 01-18-07, 14:01
RedNeckGeek RedNeckGeek is offline
Village Idiot
 
Join Date: Jul 2003
Location: Michigan
Posts: 1,941
Yeah, you shouldn't even notice a performance issue at that level.
__________________
Inspiration Through Fermentation
Reply With Quote
  #5 (permalink)  
Old 01-19-07, 13:28
shades shades is offline
Registered User
 
Join Date: Oct 2003
Posts: 1,091
With that few it shouldn't be a problem. An alternative if it is more is to use a lookup table, which doesn't require VBA.
__________________
old, slow, and confused
but at least I'm inconsistent!

Rich
(retired Excel 2003 user, 3/28/2008)

How to ask a question on forums
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On