Prompt for Value

  • Thread starter Thread starter halem2
  • Start date Start date
H

halem2

Hi:

I have the following code wich clears the cell value depending on th
number selected. In this case is number 6.

Sub DeleteRow()
Range("A1").Select
Do
If Application.IsText(ActiveCell) = "6" Then
ActiveCell.ClearContents
Application.a
Else
ActiveCell.ClearContents
ActiveCell.Offset(1, 0).Select
End If
Loop Until ActiveCell = ""
End Sub

How can I promt the user with a pop up window and use whatever the use
types as the value?

thanks a million in advance! :confused
 
Sub DeleteRow()
Range("A1").Select
Do
ans = Inputbox ("Input number please")
if and <> "" Then
If IsNumeric(ans) Then
If Application.IsText(ActiveCell) = ans Then
ActiveCell.ClearContents
Application.a
Else
ActiveCell.ClearContents
ActiveCell.Offset(1, 0).Select
End If
End If
End If
Loop Until ActiveCell = ""
End Sub

--

HTH

RP
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top