Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default how to display different content depends on some conditions?

Hi,

In one worksheet(detail), I define two ranges, Range("A1:B10") contains
food info, Range("C1:D8") contains beverage info.

And in main worksheet(order), if the customer ticks the food info box,
i want the food info I defined in worksheet(detail) displayed below the
tick box; if the customer ticks the beverage info box, i want the
beverage info I defined in worksheet(detail) displayed below the tick
box. I assumed that only one box can be chosen(either food or beverage
box).

I think I can use the IF clause to slove this problem. I know some
basic knowledge about IF clause, like IF(logic_test; true; False). I
know how to display some character in the field of ture. However, I
don,t know how to display the Range info Like Range("A1:B10") from
worksheet(detail). "if clause" can solve this problem? If you have some
relevant experience about this, could you give me some hints? Thank you
in advances!!!


Regards

Sam

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default how to display different content depends on some conditions?

Assume you are using option buttons from the forms toolbar and they are
linked to cell F1 of the sheet where the display will be made. Thus, if I
choose the food option button, F1 will display 1 and If i select the beverage
option button, F1 will display 2 (you can put one of the option buttons over
F1 to conceal it).

so option button Food is over F1 and Option button Beverage is in F2

assume the display will start in F4

in F4 put

=IF($F$1="","",IF($F$1=1,Detail!A1,IF($F$1=2,IF(RO W()11,"",Detail!C1),"")))
You could simplify it to
=if($F$1="","",if($F$1=1,Detail!A1,if(row()11,"", Detail!C1)))
but you might want to expand it later to include 3 or more choices.

Now select F4 and drag fill to G4
now select F4:G4 and drag fill down to F13:G13

--
Regards,
Tom Ogilvy





"sam" wrote:

Hi,

In one worksheet(detail), I define two ranges, Range("A1:B10") contains
food info, Range("C1:D8") contains beverage info.

And in main worksheet(order), if the customer ticks the food info box,
i want the food info I defined in worksheet(detail) displayed below the
tick box; if the customer ticks the beverage info box, i want the
beverage info I defined in worksheet(detail) displayed below the tick
box. I assumed that only one box can be chosen(either food or beverage
box).

I think I can use the IF clause to slove this problem. I know some
basic knowledge about IF clause, like IF(logic_test; true; False). I
know how to display some character in the field of ture. However, I
don,t know how to display the Range info Like Range("A1:B10") from
worksheet(detail). "if clause" can solve this problem? If you have some
relevant experience about this, could you give me some hints? Thank you
in advances!!!


Regards

Sam


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default how to display different content depends on some conditions?

HI,Tom

Thank you for your help!

I tried this method. It works.
However, it needs to drag the F4 manually to display the whole range
info. Is there any other method can display the whole range
automatively. I tried the clause F4
=if($F$1="","",if($F$1=1,Detail!$A$1:$B$10,if(row( )11,"",Detail!$C$1:$D$8))).
It doesn't work. Do you have some ideas on this issue? Thank you in
advances!!!

Best Regards

Sam

Best Regards

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default how to display different content depends on some conditions?

Can you put the formula in 1 cell and have it display 20 cells of data

In that one cell: not unless you want to concatenate all the values into a
single string - basically =formula1 & formula2 & char(10) & formula3 &
formula4 & char(10) & . . . & formula20

In a range 10 rows by 2 columns: No, you need one formula per cell - just
like I showed you.

You can enter something similar to it as an array formula, but I don't see
what the issue with doing as i said.

--
Regards,
Tom Ogilvy




"sam" wrote:

HI,Tom

Thank you for your help!

I tried this method. It works.
However, it needs to drag the F4 manually to display the whole range
info. Is there any other method can display the whole range
automatively. I tried the clause F4
=if($F$1="","",if($F$1=1,Detail!$A$1:$B$10,if(row( )11,"",Detail!$C$1:$D$8))).
It doesn't work. Do you have some ideas on this issue? Thank you in
advances!!!

Best Regards

Sam

Best Regards


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default how to display different content depends on some conditions?

HI, Tom

Thank you for your reply first!

Now, I am thinking about whether using VBA can solve this problem more
easily. Maybe first I can define an range as an object, and then call
it. Do you have some ideas on using VBA to solve it? Thank you!

Regards

Sam

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Best solution for removing duplicate content with conditions? popflier Excel Discussion (Misc queries) 2 March 5th 10 07:14 AM
Formula Bar - display of content Nadine Excel Discussion (Misc queries) 6 February 19th 10 05:31 AM
display content of merged cells LucaRR Excel Discussion (Misc queries) 2 December 30th 09 11:08 AM
Why does my cell content display as '############'? Mark Excel Discussion (Misc queries) 4 July 22nd 08 07:07 PM
display part of the cell content linda Excel Discussion (Misc queries) 4 August 28th 07 03:02 AM


All times are GMT +1. The time now is 08:22 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"