Nelson78
Well-known Member
- Joined
- Sep 11, 2017
- Messages
- 526
- Office Version
- 2007
Good morning.
I have to prevent manual errors in a data entry operation: more precisely, if the user types a space " " in a cell in the range F11:F13, a pop up has to specify in which cell, to make easier the consequent correction.
This is my attempt: the error is located in the highlighted row.
Thank's in advance.
I have to prevent manual errors in a data entry operation: more precisely, if the user types a space " " in a cell in the range F11:F13, a pop up has to specify in which cell, to make easier the consequent correction.
This is my attempt: the error is located in the highlighted row.
Code:
Sub space()
Dim cell As Range
For Each cell In Range("F11:F13")
If InStr(1, cell, " ", 1) Then [B]MsgBox ("In the cell" & Range("F11:F13").Value & " you have typed a space")[/B]
Next
End Sub
Thank's in advance.
Last edited: