Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How can I use conditional formatting to hide or delete rows? | Excel Worksheet Functions | |||
How can i hide a row or delete | Excel Discussion (Misc queries) | |||
How do I delete columns and rows in Excel, not just hide them | Excel Discussion (Misc queries) | |||
Use formula to hide/delete cell? | Excel Worksheet Functions | |||
Hide/Delete XL Menus | Excel Programming |