ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 5,226
- Office Version
- 2007
- Platform
- Windows
Evening,
I have a command button on my worksheet with the following code.
when ever i make an edit to how the sheet looks / works etc i use it to clear the cells so i can then save the file & this then is my new updated worksheet.
The code works fine BUT i get the annoying RTE as per title.
When i debug it i see the following shown in red below highlighted.
When i use the worksheet i type L in the cell in column D then once i leave the cell the L is replaced by the value 4
This is just speed related save me typing it out all the time.
This isnt any issue but its annoying to keep the RTE pop up.
Can we somehow stop it.
Many thansk
I have a command button on my worksheet with the following code.
when ever i make an edit to how the sheet looks / works etc i use it to clear the cells so i can then save the file & this then is my new updated worksheet.
The code works fine BUT i get the annoying RTE as per title.
When i debug it i see the following shown in red below highlighted.
Rich (BB code):
Private Sub ClearSheetValues_Click()
Dim answer As Integer
answer = MsgBox("THIS WILL CLEAR ALL CELL VALUES" & vbNewLine & "CLICK YES TO CONTINUE", vbYesNo + vbCritical, "ACCOUNTS CLEAR VALUES MESSAGE")
If answer = vbNo Then
Exit Sub
Else
End If
Range("B1:D1").SpecialCells(xlCellTypeConstants).ClearContents
Range("A3:D29").SpecialCells(xlCellTypeConstants).ClearContents
Range("A34").SpecialCells(xlCellTypeConstants).ClearContents
End Sub
Rich (BB code):
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("D3:D29")) Is Nothing Then
If UCase(Target.Value) = "L" Then Target.Value = "4"
If UCase(Target.Value) = "W" Then Target.Value = "5"
If UCase(Target.Value) = "C" Then Target.Value = "7"
End If
If Not (Application.Intersect(Target, Range("A2:D29")) _
Is Nothing) Then
With Target
If Not .HasFormula Then
Application.EnableEvents = False
.Value = UCase(.Value)
Application.EnableEvents = True
End If
End With
End If
End Sub
When i use the worksheet i type L in the cell in column D then once i leave the cell the L is replaced by the value 4
This is just speed related save me typing it out all the time.
This isnt any issue but its annoying to keep the RTE pop up.
Can we somehow stop it.
Many thansk