Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Willie Howell   on Mar 04 In MS Office Category.

  
Question Answered By: Vidisha Pathak   on Mar 04

Private Sub ToggleButton1_Click()

With ToggleButton1
Rows(6).Hidden = .Value
Rows(8).Hidden = .Value
Rows(10).Hidden = .Value
Rows(12).Hidden = .Value
Rows(14).Hidden = .Value
Rows(16).Hidden = .Value
Rows(18).Hidden = .Value
Rows(20).Hidden = .Value
Rows(22).Hidden = .Value
Rows(24).Hidden = .Value
Rows(26).Hidden = .Value
Rows(28).Hidden = .Value
Rows(30).Hidden = .Value
Rows(32).Hidden = .Value
Rows(34).Hidden = .Value
Rows(36).Hidden = .Value
End With
End Sub

2 nd Procedure

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'Formatting all input  as caps
Dim rngCell As Range

On Error GoTo ws_exit
Application.EnableEvents = False

If Not Intersect(Target, Range("B1:AQ37")) Is Nothing Then

For Each rngCell In Target
rngCell.Value = UCase(rngCell.Value)
Next rngCell

ElseIf Not Intersect(Intersect(Target, _
Range("I7:M37,Q7:T37,W7:AA37,AD7:AH37,AK7:AK37"))) Is Nothing
Then
For Each cl In Target
Select Case cl.Text
Case "": cl.Interior.ColorIndex = 0
Case "V": cl.Interior.ColorIndex = 44
Case "M": cl.Interior.ColorIndex = 43
Case "C": cl.Interior.ColorIndex = 6
Case "T": cl.Interior.ColorIndex = 32
Case "TB": cl.Interior.ColorIndex = 33
Case "H": cl.Interior.ColorIndex = 4
Case "HD": cl.Interior.ColorIndex = 4
Case "S": cl.Interior.ColorIndex = 3
Case "B": cl.Interior.ColorIndex = 16
End Select
Next cl
End If

ws_exit:
Application.EnableEvents = True
End Sub

Share: 

 

This Question has 13 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on How to run multiple procedure within Vba Or get search suggestion and latest updates.


Tagged: