Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default help with hide or delete

i have the following code to hide rows based on specific text:
Sub search()
Dim cell As Range
Application.ScreenUpdating = False
For Each cell In Range("A12:A5000")
If cell.Value = "RTRSSTCK" Then
cell.EntireRow.Hidden = True
ElseIf cell.Value = 1 Then
cell.EntireRow.Hidden = False
End If
Next
Application.ScreenUpdating = True
End Sub

How would i change the code to delete the row with the text and shif
everything else up

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default help with hide or delete

Hi Aacarril.,

Ok, you want to *delete* rows where the column A value is "RTRSSTCK and you
want to *hide* rows where the column A value =1 ?

In your code replace the line:

cell.EntireRow.Hidden = True


with:

cell.EntireRow.delete



---
Regards,
Norman



"acarril " wrote in message
...
i have the following code to hide rows based on specific text:
Sub search()
Dim cell As Range
Application.ScreenUpdating = False
For Each cell In Range("A12:A5000")
If cell.Value = "RTRSSTCK" Then
cell.EntireRow.Hidden = True
ElseIf cell.Value = 1 Then
cell.EntireRow.Hidden = False
End If
Next
Application.ScreenUpdating = True
End Sub

How would i change the code to delete the row with the text and shift
everything else up?


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default help with hide or delete

Just a warning: the replacement line should not include the greater than
()symbol!

---
Regards,
Norman



"Norman Jones" wrote in message
...
Hi Aacarril.,

Ok, you want to *delete* rows where the column A value is "RTRSSTCK and

you
want to *hide* rows where the column A value =1 ?

In your code replace the line:

cell.EntireRow.Hidden = True


with:

cell.EntireRow.delete



---
Regards,
Norman



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default help with hide or delete

Thanks Norman that was great

--
Message posted from http://www.ExcelForum.com

Reply
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
How can I use conditional formatting to hide or delete rows? linda.beautiful.california Excel Worksheet Functions 6 July 15th 08 09:09 PM
How can i hide a row or delete algebroni Excel Discussion (Misc queries) 4 February 9th 07 09:39 PM
How do I delete columns and rows in Excel, not just hide them Eddie Excel Discussion (Misc queries) 2 November 23rd 05 05:11 PM
Use formula to hide/delete cell? Lost! Excel Worksheet Functions 3 June 3rd 05 12:05 AM
Hide/Delete XL Menus Rockee052[_40_] Excel Programming 4 February 18th 04 04:18 PM


All times are GMT +1. The time now is 09:15 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"