Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Show Only Fields Needed

Status
Not open for further replies.

TJVFree

Technical User
Nov 22, 2010
236
US
Hello,

I’m trying to make an excel spread sheet that will provide only questions needed depending on the color they pick

Example:
If they pick blue I would like a to show only the questions then need to fill out for blue and restrict access to any other colors.

There much be a better way to show only information you want depending on which color is chosen without having to put IF starts all over on the spread sheet

IF( A1, Blue, IF( show Blue Sheet Only, All Sheets, Blank ))

IF condition1 THEN
show Blue Sheet Only
ELSEIF condition2 THEN
All Sheets
ELSE
Blank
END IF

Any help would be greatly appreciated



TCB
 
Okay, sheet structure is not the issue. Sorry.

How about something like this...
Code:
Dim ws As Worksheet

For Each ws in Worksheets
   Select case ws.name
       Case [A1], "MainSheet"
          ws.Visible = xlSheetVisible
       Case else
          ws.Visible = xlSheetHidden
   End Select
Next

...where "MainSheet" is really your main sheet name and each sheet tab name is the name of a color that might appear in A1.
 
Thank you SkipVought. I will try it

TCB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top