help with code

G

Guest

hi I have this part of a code:

If IsError(.Cells(Lrow, "E").Value) Then
ElseIf .Cells(Lrow, "E").Value = "2" And _
.Cells(Lrow, "G").Value <> 0 Then .Rows(Lrow).Delete

but instead of having value "2" i'd prefer to have a box pop up that askes
me for this value each time, something like this I guess:

Dim V As Variant
V = Application.InputBox(prompt:="Enter number of month.", Type:=1)
If V = False Then
Debug.Print "User clicked cancel"

but how do I combine the 2 parts of code? any suggestions?

S.
 
G

Guest

sorry guess i am as newbe as it gets... can't figure this out... can anyone
help me out with the code?

thanks.
 
G

Guest

Sorry
Note: the original code had "2" in the inputbox which indicated 2 was a
string. The Input box 2 is for text like the old code, if you waqnt a number
then change the 2 to a 1.


Dim V As string
If IsError(.Cells(Lrow, "E").Value) Then

V = Application.InputBox(prompt:="Enter number of month.", Type:=2)
If V = False Then
Debug.Print "User clicked cancel"
Else
if .Cells(Lrow, "E").Value = V And _
.Cells(Lrow, "G").Value <> 0 Then .Rows(Lrow).Delete
end if
end if
 

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

Top