PC Review


Reply
Thread Tools Rate Thread

Deleting specific rows after an autofilter

 
 
forbrowsing
Guest
Posts: n/a
 
      16th Jan 2007
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

 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      16th Jan 2007
Rows(Rownumber)
may work for you.



forbrowsing wrote:
>
> 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


--

Dave Peterson
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Deleting specific rows with a specific criteria using inputbox Greg Microsoft Excel Programming 2 10th Apr 2008 04:31 PM
Excel 2007 - Deleting Rows from a Table with AutoFilter TomC Microsoft Excel Programming 1 9th Mar 2007 10:10 PM
Deleting rows in a range using Autofilter Connie Microsoft Excel Misc 3 17th Oct 2006 01:47 PM
Generalising Deleting Rows after AUTOFILTER jason Microsoft Excel Programming 3 5th Nov 2004 02:17 PM
Speed up Autofilter deleting rows LS Microsoft Excel Programming 6 26th Mar 2004 05:39 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:01 PM.