View Single Post
  #16   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 1,726
Default Delete Entire Row if value is not Q

You still had a copy Destination in there with Pastespecial.

try this

Sub FormatArea1()
Application.ScreenUpdating = False
Sheets("Month").Activate
Cells.Select
Selection.Copy
Sheets("Area 1").Activate
Range("A1").Select
Selection.PasteSpecial Paste:=xlFormats
Selection.PasteSpecial Paste:=xlPasteValues
ActiveWindow.DisplayGridlines = False
ActiveWindow.Zoom = 75

For i = 39 To 8 Step -1
Select Case Cells(i, 1).Value
Case "City1", "City2", "City3"
Case Else
Rows(i).Delete Shift:=xlUp
End Select
Next i
Range("A1").Select

Sheets("Cumulative").Activate
Cells.Select
Selection.Copy
Sheets("Area 1").Activate

Worksheets("Cumulative").Range("A1:O39").Copy
Worksheets("Area1").Range("A65536").End(xlUp).Offs et(6).PasteSpecial
Paste:=xlPasteValues

For i = 66 To 34 Step -1
Select Case Cells(i, 2).Value
Case "City1", "City2", "City3"
Case Else
Rows(i).Delete Shift:=xlUp
End Select
Next i
Range("A1").Select
Sheets("Month").Activate
Range("A1").Select
End Sub

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Sean" wrote in message
oups.com...
Here it is Bob

Sub FormatArea1()
Application.ScreenUpdating = False
Sheets("Month").Activate
Cells.Select
Selection.Copy
Sheets("Area 1").Activate
Range("A1").Select
Selection.PasteSpecial Paste:=xlFormats
Selection.PasteSpecial Paste:=xlPasteValues
ActiveWindow.DisplayGridlines = False
ActiveWindow.Zoom = 75

For i = 39 To 8 Step -1
Select Case Cells(i, 1).Value
Case "City1", "City2", "City3"
Case Else
Rows(i).Delete Shift:=xlUp
End Select
Next i
Range("A1").Select


Sheets("Cumulative").Activate
Cells.Select
Selection.Copy
Sheets("Area 1").Activate

Worksheets("Cumulative").Range("A1:O39").Copy Destination:= _

Worksheets("Area1").Range("A65536").End(xlUp).Offs et(6).PasteSpecial _
Paste:=xlPasteValues




For i = 66 To 34 Step -1
Select Case Cells(i, 2).Value
Case "City1", "City2", "City3"
Case Else
Rows(i).Delete Shift:=xlUp
End Select
Next i
Range("A1").Select
Sheets("Month").Activate
Range("A1").Select
End Sub