willow1985
Well-known Member
- Joined
- Jul 24, 2019
- Messages
- 929
- Office Version
- 365
- Platform
- Windows
Hi I was hoping someone could help me with this.
I am looking to call different macros depending on what text is in column C on the same row of a selected cell.
So when I select "Open" on Cell Y2, the macro will check text in cell C2 (-22) and call a macro depending on the text in that cell.
If ActiveCell.Offset(0, -22).Range("A1") = "Customer Concern" Call CC
If ActiveCell.Offset(0, -22).Range("A1") = "CAPA" Call CAPA
If ActiveCell.Offset(0, -22).Range("A1") = "Interruptions" Call Interruptions
If ActiveCell.Offset(0, -22).Range("A1") = "Supplier Non-Conformance" Call NCR
If ActiveCell.Offset(0, -22).Range("A1") = 'anything else "Please select a valid Quality Issue Type"
End sub
I know this is not correct but I am looking for something like this.
Thank you to anyone who can help.
What I have so far:
I am looking to call different macros depending on what text is in column C on the same row of a selected cell.
So when I select "Open" on Cell Y2, the macro will check text in cell C2 (-22) and call a macro depending on the text in that cell.
If ActiveCell.Offset(0, -22).Range("A1") = "Customer Concern" Call CC
If ActiveCell.Offset(0, -22).Range("A1") = "CAPA" Call CAPA
If ActiveCell.Offset(0, -22).Range("A1") = "Interruptions" Call Interruptions
If ActiveCell.Offset(0, -22).Range("A1") = "Supplier Non-Conformance" Call NCR
If ActiveCell.Offset(0, -22).Range("A1") = 'anything else "Please select a valid Quality Issue Type"
End sub
I know this is not correct but I am looking for something like this.
Thank you to anyone who can help.
What I have so far:
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("Y:Y")) Is Nothing Then Exit Sub
Select Case Target.Text
Case "Open": Call Complete_File
Case "Closed": Call Verify_Form
Case Else: Exit Sub
End Select
End Sub
Sub Complete_File()
'
' Complete_File Macro
'
Dim msg As String, ans As Variant, lr As Long, Sh As Worksheet, lo As ListObject
If Application.CountIf(Sheets("CC Database").Range(Cells(Selection.Row, 1), Cells(Selection.Row, 20)), "") > 0 Then
MsgBox "Please Complete all manditory fields (Columns B to T)"
Range(Cells(Selection.Row, 25), Cells(Selection.Row, 25)).ClearContents
Exit Sub
End If
‘*****Add requested code here*****
Book1 | ||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | AA | AB | AC | AD | AE | AF | |||
1 | New Identifier | Original Identifier | Type | Date Opened | Opened by | Estimated Completion Date | Division | Area/Department/Cell | Source | Discrepancy/Issue/Reason | Work Order/Job # | PO# | Model # | Qty | Corresponding NCR/CC/CAPA/Interruption # | Customer/Vendor | Part Name / Description | Part Number / Document Reference | Serial # / Process | Owner | Verification/Action/Repaired | Warranty Granted Y/N /Reprocess | Comments/Notes | Flag Date | Status | Closed Date | Man Hours | Labour Cost | Material Cost | Total Cost | Work done in good faith | Total Days Active | ||
2 | Q5000 | CC1234 | Customer Concern | 30-Oct-24 | 1st Division | Front | Error | N/A | 123456 | N/A | 1 | 5555 | Customer | Part | 444444 | Open | ||||||||||||||||||
Sheet1 |
Cells with Data Validation | ||
---|---|---|
Cell | Allow | Criteria |
Y2 | List | =Sheet2!$A$1:$A$2 |