LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 60
Default Delete Rows Button

I'm using this code to delete all the rows that have "RG" in the A
column. It should run through the entire range A1:A50 when I click a
userform button. But instead of deleting them all with one click, its
just deleting one of the "RG" rows each time I click the button (or
even a few of the rows, but not all). Can anyone help?

Private Sub RunReport_Click()
For Each dept In Range("A1:A50")
If dept.Value = "RG" Then
Rows(dept.Row).Delete
End If
Next dept
End Sub
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete/Remove Button Jwil Excel Discussion (Misc queries) 9 December 4th 08 07:04 PM
How to delete a button Turquoise_dax Excel Discussion (Misc queries) 4 June 15th 06 08:50 PM
Delete Data Button Marcus Excel Discussion (Misc queries) 3 May 2nd 06 03:23 AM
How can I delete a macro when the Delete button is not active? FCR Excel Worksheet Functions 0 March 9th 06 09:43 AM
How to delete rows when List toolbar's "delete" isnt highlighted? Linda Excel Worksheet Functions 1 May 26th 05 08:39 PM


All times are GMT +1. The time now is 07:56 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"