James Allensworth
New Member
- Joined
- Mar 26, 2020
- Messages
- 2
- Office Version
- 2016
- Platform
- Windows
In my worksheet cell A30, which is the anchor cell of multiple merged cells. I have the custom format "Comments/Clarifications:" @. When characters including spaces are entered in the merged range then the format appears. When the cell is empty of all characters including spaces then the merged range appears empty without the "Comments/Clarifications:" text. Which, as you know, is the way Excel operates. What I cant to do is use VBS Code to look at the cell when data has been deleted and insert a blank space so the formatted text statement will appear.
This what I have tried;
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim c As Range
Set c = Range("a30")
If Selection.Count = 1 Then
If Not Intersect(Target, c) Is Nothing Then
c.Value = " " & c.Value On this command line I have also tried using a call statement to load a Macro which basically would put a space in cell a30
End If
End If
End Sub
Thank you for any thoughts or workarounds.
Jim
This what I have tried;
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim c As Range
Set c = Range("a30")
If Selection.Count = 1 Then
If Not Intersect(Target, c) Is Nothing Then
c.Value = " " & c.Value On this command line I have also tried using a call statement to load a Macro which basically would put a space in cell a30
End If
End If
End Sub
Thank you for any thoughts or workarounds.
Jim