Try this example
Event Macro Code
Private Sub Worksheet_Change(ByVal Target As Range)
Application.ScreenUpdating = False
If Target.Address = "$A$7" Then
If Target.Value <> "Custom" Then
Range("C13:C27").Formula = "=quicknetwork(A7)"
End If
End If
Application.ScreenUpdating = True
End Sub
Module Code
Function quicknetwork(quick1 As String)
Select Case LCase(quick1)
Case "show all network space available", _
"show all network space utilized", _
"show all space available", _
"show all space utilized"
quicknetwork = "ALL"
Case "Custom"
quicknetwork = ""
Case Else
quicknetwork = "NONE"
End Select
End Function
Amended - Or this shorter code
Function quicknetwork(quick1 As String)
Select Case True
Case LCase(quick1) Like "*show all*"
quicknetwork = "ALL"
Case LCase(quick1) Like "*custom*"
quicknetwork = ""
Case Else
quicknetwork = "NONE"
End Select
End Function
ThisWorksheet Module To turn on events
Private Sub Workbook_Open()
Application.ScreenUpdating = True
End Sub
VBA Noob
Bookmarks