Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Does any of you have a minute to share with how i can validate input of a range of a sheet and not allow other than numbers + a msgbox about that? I already use the excel GUI "Validation" functions for other reasons, so I need to have this in code in a worksheet_change event. /Thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You could try something like this:
Dim vntCol As Variant Dim vntRow As Variant Dim strX As String For Each vntRow In Selection.Rows For Each vntCol In Selection.Columns With ActiveSheet.Cells(vntRow.Row, vntCol.Column) strX = .Value If IsNumeric(strX) = False Then strX = "Row " & CStr(vntRow.Row) & _ ", Column " & CStr(vntCol.Column) & _ " is not numeric." MsgBox strX End If End With Next vntCol Next vntRow Regards, Wes |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Bold Text In Msgbox | Excel Discussion (Misc queries) | |||
VBA MsgBox() Text | Excel Programming | |||
input box , msgbox, formula | Excel Programming | |||
Using different lines in an input- or msgbox | Excel Programming | |||
MsgBox and User Input | Excel Programming |