Deleting specific rows after an autofilter

F

forbrowsing

I have the following line in a macro

rows("32:32")

I would like to have it so that we can vary, to, say rows("38:38"). The
value in rownumber variable i want to pass to this line
rows("rownumber:rownumber"). Can someone help me with that ?

Sub test()

Dim rownumber As Integer
Dim flag As Integer
Dim answer As Integer

'rownumber = InputBox("Enter a rownumber: ")
'MsgBox "The rownumber entered is : " & rownumber
'Answer = MsgBox("Do you want to continue ? ", vbYesNo)
answer = 7 ' flag = 1
Do While answer = 7
rownumber = InputBox("Enter a rownumber: ")
MsgBox "The rownumber entered is : " & rownumber
answer = MsgBox("Is the row number correct ?", vbYesNo)
' If answer = 6 Then flag = 0
Loop

MsgBox "the rownumber used is : " & rownumber
End Sub
 
D

Dave Peterson

Rows(Rownumber)
may work for you.


I have the following line in a macro

rows("32:32")

I would like to have it so that we can vary, to, say rows("38:38"). The
value in rownumber variable i want to pass to this line
rows("rownumber:rownumber"). Can someone help me with that ?

Sub test()

Dim rownumber As Integer
Dim flag As Integer
Dim answer As Integer

'rownumber = InputBox("Enter a rownumber: ")
'MsgBox "The rownumber entered is : " & rownumber
'Answer = MsgBox("Do you want to continue ? ", vbYesNo)
answer = 7 ' flag = 1
Do While answer = 7
rownumber = InputBox("Enter a rownumber: ")
MsgBox "The rownumber entered is : " & rownumber
answer = MsgBox("Is the row number correct ?", vbYesNo)
' If answer = 6 Then flag = 0
Loop

MsgBox "the rownumber used is : " & rownumber
End Sub
 

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