This would work:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Value = "In service" Then
Target = "Out of service"
ElseIf Target.Value = "Out of service" Then
Target = "In service"
End If
End Sub
More Related Contents:
- Want to concatenate multiple row data in in cell along with its values if present. Emp Id should not come if no data available infromt of it
- Excel VBA – How to add dynamic array formula
- What is the difference between “Form Controls” and “ActiveX Control” in Excel 2010?
- Check if the file exists using VBA
- How can I create a progress bar in Excel VBA?
- Compare double in VBA precision problem
- Row count on the Filtered data
- Excel VBA Macro: User Defined Type Not Defined
- Automate IE via Excel to fill in a dropdown and continue
- Run-Time error 1004 Excel 2013
- VBA – Write all possible combinations of 4 columns of data [duplicate]
- Pasting an Excel range into an email as a picture
- Excel VBA to Export Selected Sheets to PDF
- Remove duplicates from array using VBA
- Controlling Internet Explorer local intranet using Excel VBA
- How to automatically insert a blank row after a group of data
- Rounding in MS Access
- Count unique values in Excel
- Get File Path (ends with folder)
- Get length of array?
- Email a single attachment from folder of files each to a different person
- Bad data selection using VBScript , on date field values
- Sending object array to variant works before August 2019 Windows update, but fails after update
- Find last row in range
- Differences between Excel’s Form Controls & ActiveX Controls
- Excel VBA User Defined Function that counts cells with conditional formatting
- Excel is calculating a formula with a VBA function as an error unless it is re-entered
- Access files with long paths (over 260)
- How to highlight selected text within excel
- How to fix a VBA “type mismatch” error after switching to 64-bit Excel