I'm checking spelling in Excel using VBA and was looking to have 2 functionalities.
1. Go to cell when checking. This is done with Cell.Select.
2. If Esape or Close is pressed, to Exit. It works with If Not Cell.CheckSpelling Then Exit Sub, but then then you can't go the cell for some reason.
Is there a way to have both work?
1. Go to cell when checking. This is done with Cell.Select.
2. If Esape or Close is pressed, to Exit. It works with If Not Cell.CheckSpelling Then Exit Sub, but then then you can't go the cell for some reason.
Is there a way to have both work?
VBA Code:
Sub Spelling()
Dim Cell As Range
For Each Cell In ActiveSheet.UsedRange
'If Not Cell.CheckSpelling Then Exit Sub
If Len(Cell) > 0 Then
Cell.Select
Cell.CheckSpelling
End If
Next Cell
End Sub