paulfitz54
New Member
- Joined
- Dec 30, 2014
- Messages
- 32
- Office Version
- 2019
- Platform
- MacOS
Hello,
I am trying to run macros from a validation list, all macros have been created and run perfectly on there own but I'm getting a compile error when Im trying to run them from the validation list.
Any help would be greatly appreciated
I am using MS Office 2016 for Mac
Thank you in advance,
Paul
I have pasted the code below;
I am trying to run macros from a validation list, all macros have been created and run perfectly on there own but I'm getting a compile error when Im trying to run them from the validation list.
Any help would be greatly appreciated
I am using MS Office 2016 for Mac
Thank you in advance,
Paul
I have pasted the code below;
VBA Code:
'Event code, Target variable contains the cell or range that has been changed
Private Sub Worksheet_Change(ByVal Target As Range)
'Interesect method returns a range object of a rectangular intersection of two or more cell ranges
If Target.Address(True, True) = "$B$3" Then
'Select Case statment performs one out of several groups of statements based on a condition
Select Case Target
'If text in cell B3 is equal to Automation a macro named Automation is executed
Case "Automation"
Call Automation
'If text in cell B3 is equal to Basic Curriculum a macro named Basic is executed
Case "Basic Curriculum": Basic
'If text in cell B3 is equal to Cleaning a macro named Cleaning is executed
Case "Cleaning": Cleaning
'If text in cell B3 is equal to Engineering a macro named Engineering is executed
Case "Engineering": Engineering
'If text in cell B3 is equal to Facilities a macro named Facilities is executed
Case "Facilities": Facilities
'If text in cell B3 is equal to GSC a macro named GSC is executed
Case "GSC": GSC
'If text in cell B3 is equal to GSC Quality a macro named GSC Quality is executed
Case "GSC Quality": GSCQuality
'If text in cell B3 is equal to HR a macro named HR is executed
Case "HR": HR
'If text in cell B3 is equal to IT a macro named IT is executed
Case "Cleaning": Cleaning
'If text in cell B3 is equal to Engineering a macro named Engineering is executed
Case "IT": IT
'If text in cell B3 is equal to Labeling a macro named Labeling is executed
Case "Labeling": Labeling
'If text in cell B3 is equal to Maintenance a macro named Maintenance is executed
Case "Maintenance": Maintenance
'If text in cell B3 is equal to Materials a macro named Materials is executed
Case "Materials": Materials
'If text in cell B3 is equal to Operations a macro named Operations is executed
Case "Operations": Operations
'If text in cell B3 is equal to Quality macro named Quality is executed
Case "Quality": Quality
'If text in cell B3 is equal to Safety a macro named Safety is executed
Case "Safety": Safety
'If text in cell B3 is equal to Training a macro named Training is executed
Case "Training": Training
'If text in cell B3 is equal to Validation a macro named Validation is executed
Case "Validation": Validation
'Stops Select Case statement
End Select
End If
End Sub