LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Repetitive IF statement

Excuse my extremely novice post, I've been looking through google
groups to find the answer to my problem but haven't got very far..

I want to simplify the below IF statement:

Private Sub CommandButton11_Click()

' Selection of component type
If OptionButton1 = True Then
Sheets("GIT XP CLIENT STATS").Visible = True
Sheets("GROUP IT SUPPORTED XP CLIENT").Visible = True
Else
If OptionButton2 = True Then
Sheets("GIT SILO STATS").Visible = True
Sheets("GROUP IT SUPPORTED SILO SERVER").Visible = True
Else
If OptionButton3 = True Then
Sheets("GIT FARM STATS").Visible = True
Sheets("GROUP IT SUPPORTED SERVER FARM").Visible = True
Else
If OptionButton4 = True Then
Sheets("NGIT XP CLIENT STATS").Visible = True
Sheets("NON-GIT SUPPORTED XP CLIENT").Visible = True
Else
If OptionButton5 = True Then
Sheets("NGIT SILO STATS").Visible = True
Sheets("NON-GIT SUPPORTED SILO SERVER").Visible = True
Else
If OptionButton6 = True Then
Sheets("NGIT FARM STATS").Visible = True
Sheets("NON-GIT SUPPORTED SERVER FARM").Visible = True
Else
If OptionButton7 = True Then
Sheets("SW XP CLIENT STATS").Visible = True
Sheets("SHRINK WRAPPED XP CLIENT").Visible = True
Else
If OptionButton8 = True Then
Sheets("SW SILO STATS").Visible = True
Sheets("SHRINK WRAPPED SILO SERVER").Visible = True
Else
If OptionButton9 = True Then
Sheets("SW FARM STATS").Visible = True
Sheets("SHRINK WRAPPED SERVER FARM").Visible = True
Else
If OptionButton10 = True Then
Sheets("BUNDLE STATS").Visible = True
Sheets("BUNDLE").Visible = True
Else
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
Sheets("START").Visible = False
ActiveSheet.Range("A1").Select
ActiveCell = "Component Name: " & TextBox1.Text
End Sub

This above Sub works but is very long winded. This also only populates
the active sheet with the text entered into the textbox in cell A1 - I
want to populate a cell on each sheet.

I am unsure how to do this as the sheet name changes depending on the
selected option button.

Any help is much appreciated..

 
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
Repetitive macros rcarolina Excel Discussion (Misc queries) 1 April 7th 10 12:10 AM
Repetitive Numbers Katelyn Excel Discussion (Misc queries) 1 February 19th 07 08:50 PM
Repetitive keystroke Andre Croteau Excel Discussion (Misc queries) 3 October 7th 06 02:20 AM
repetitive Repetitive formula Excel Discussion (Misc queries) 2 June 28th 06 05:59 AM
Repetitive IF THEN Statement Todd Huttenstine[_3_] Excel Programming 1 January 27th 04 05:12 AM


All times are GMT +1. The time now is 03:33 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"