Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I got a problem with my vba UserForm, here is the code:
Private Sub CommandButton1_Click() Dim r As Variant Dim C As Integer C = TextBox1.Text If IsNumeric(C) = False Then MsgBox "Please enter an integer." Else For r = 1 To 700 If Cells(r, C).Value = "0" Then Rows(r).Hidden = True End If Next End If End Sub I'd like to make it when people key in a non-numeric character in the textbox, it will promt out the message,however, when i Dim C As Integer, once we key in a non numeric char it will cause a run time error,since it is not an integer as i declared and if i Dim c As Variant, the Cells(r,c) will not work as Cells() required an integer inside. Can anyone tell me how to solve the problem? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
modifying code in run time | Excel Programming | |||
Help is needed for modifying this code. | Excel Programming | |||
Need Help Modifying Code | Excel Programming | |||
Help modifying code | Excel Programming | |||
Modifying Code that deletes a Row | Excel Programming |