Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default msgbox if you input text instead of numbers

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default msgbox if you input text instead of numbers

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Bold Text In Msgbox FARAZ QURESHI Excel Discussion (Misc queries) 2 April 10th 09 08:26 AM
VBA MsgBox() Text gkelle[_9_] Excel Programming 2 April 20th 04 08:32 PM
input box , msgbox, formula lost Excel Programming 3 April 14th 04 02:31 PM
Using different lines in an input- or msgbox Syrus the Virus[_16_] Excel Programming 3 March 2nd 04 12:35 PM
MsgBox and User Input Terrin Excel Programming 2 September 9th 03 09:05 PM


All times are GMT +1. The time now is 11:17 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"