Hidden rows reappearinmg when macro deletes rows

C

Code Numpty

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?
 
R

RyanH

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.
 
C

Code Numpty

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).EntireRow.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).EntireRow.Delete
- - - - - - - - - - - - - - - - - - -
- - - - -
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top