![]() |
Hidden rows reappearinmg when macro deletes rows
My Excel 2003 worksheet has rows and columns outside the work area hidden.
I have a macro that deletes rows that do not contain anything in the first cell and other specific criteria. When the macro has finished I have new blank rows appearing at the end of the work area, replacing those that have been deleted, ending with row number 31815. Is there a way to keep these rows hidden? |
Hidden rows reappearinmg when macro deletes rows
Are you actually deleting the row or are you just clearing contents? I find
it odd that rows are just magically reappearing. You should post your code so we can see what possible problems there are. -- Cheers, Ryan "Code Numpty" wrote: My Excel 2003 worksheet has rows and columns outside the work area hidden. I have a macro that deletes rows that do not contain anything in the first cell and other specific criteria. When the macro has finished I have new blank rows appearing at the end of the work area, replacing those that have been deleted, ending with row number 31815. Is there a way to keep these rows hidden? |
Hidden rows reappearing when macro deletes rows
Hi Ryan, I am deleting rows. Code follows between the dotted lines (lots of
it). Grateful for any advice on this. ----------------------------------------------------------------------------- Sub Quote_Wrapup() 'To stop screen flicker Application.ScreenUpdating = False Sheet1.Range("quote_date") = Sheet1.Range("quote_date").Value Range("qdata5,qdata6").Font.ColorIndex = 2 'To delete delivery address lines if 1st line empty If IsEmpty(Range("deliver_line1")) _ Then Sheets(1).Range("deliver_rows").EntireRow.Delete 'No End If required as only one action as a result of the If Range("Item_Nos").SpecialCells(xlCellTypeBlanks).E ntireRow.Delete Sheet1.Range("content") = Sheet1.Range("content").Value Call NoDVinputMsg ActiveSheet.Shapes("Group 31").Delete Rows("1:1").Delete Shift:=xlUp ActiveSheet.Shapes("Picture 14").Delete Range("A:G").Interior.ColorIndex = xlNone 'Desperately trying to speed up delete column E! Application.Calculation = xlCalculationManual Application.EnableEvents = False ActiveSheet.Range("base_p").Delete Shift:=xlToLeft Application.EnableEvents = True Application.Calculation = xlCalculationAutomatic Range("comm_disclines").Delete Shift:=xlUp Range("boxes").Borders.LineStyle = x1None Range("delterms_box").ClearContents Sheets("Instructions").Select ActiveSheet.Name = "Terms&Conditions" Range("instructions").Delete ActiveSheet.Shapes("Object 1").Delete Range("A1").Select Sheets("Quotation").Select Range("qdata1").Select Dim vbCom As Object Call logquote Application.ScreenUpdating = True Range("A1:F1").Select With Selection .HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter .MergeCells = True End With On Error Resume Next Set vbCom = ActiveWorkbook.VBProject.VBComponents vbCom.Remove VBComponent:= _ vbCom.Item("Module3") vbCom.Remove VBComponent:= _ vbCom.Item("Module4") On Error GoTo 0 End Sub ----------------------------------------------------------------------------- This is the line which may delete up to 250 rows - - - - - - - - - - - - - - - - - - - - - - - - Range("Item_Nos").SpecialCells(xlCellTypeBlanks).E ntireRow.Delete - - - - - - - - - - - - - - - - - - - - - - - - "RyanH" wrote: Are you actually deleting the row or are you just clearing contents? I find it odd that rows are just magically reappearing. You should post your code so we can see what possible problems there are. -- Cheers, Ryan "Code Numpty" wrote: My Excel 2003 worksheet has rows and columns outside the work area hidden. I have a macro that deletes rows that do not contain anything in the first cell and other specific criteria. When the macro has finished I have new blank rows appearing at the end of the work area, replacing those that have been deleted, ending with row number 31815. Is there a way to keep these rows hidden? |
All times are GMT +1. The time now is 12:16 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com