# How to check numeric?

#### daniel50096230

##### Board Regular
Hi,I would like to validate that the row that choose by the user is end with 3...Means 3,13,23,33...How can I validate it?

### Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

#### xenou

##### MrExcel MVP
Validate in what way? -- Is this a macro? A formula?

= Right(RowValue,1) = 3

This would work in VBA or as a spreadsheet formula. You can use Row() to get the row value, i.e.:
=Right(Row(A3),1) = 3 | True
=Right(Row(A13),1) = 3 | True
=Right(Row(A20),1) = 3 | False

AB

#### daniel50096230

##### Board Regular
I would like to validate it using macro...If the user choose the row not end with 3,then a message box will be prompt.

#### xenou

##### MrExcel MVP
In what way is the user choosing? Is this using the input box?

In short,
Code:
``````Sub test()
Dim r As Range

Set r = Application.InputBox(Prompt:="Pick a cell.", Type:=8)

If r.Rows.Count = 1 Then
If Right(r.Row, 1) <> 3 Then
End If
Else
MsgBox "You picked more than one row!!"
End If

End Sub``````

#### daniel50096230

##### Board Regular
Good,your code is excellent to my system...thanks.........But in the input box,if the user click Cancel without choosing any row,there will be error,may i know how to avoid this error?

#### xenou

##### MrExcel MVP
Hi, in a hurry here but I think this will help out (it's my "canned" routine):

Code:
``````Sub InputBoxToSelectRange()
Dim r As Range

On Error GoTo Handler
Set r = Application.InputBox("Select the Range to Process", Type:=8)
On Error GoTo 0

~~Proceed with the rest of your routine here.

Handler:
MsgBox "You cancelled!!"
End Sub``````

You just use some on the spot error-handling to deal with that.

Replies
1
Views
90
Replies
12
Views
609
Replies
3
Views
75
Replies
13
Views
136
Replies
3
Views
70

1,191,587
Messages
5,987,508
Members
440,098
Latest member
MickyMouse123

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back