Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 454
Default Delete Entire Row if value is not Q

On Feb 7, 1:58 pm, "Bob Phillips" wrote:
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- Hide quoted text -


- Show quoted text -


Thanks all its working now

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
Delete Entire Row Corey Excel Programming 4 February 6th 07 12:24 AM
Delete entire row if David T Excel Discussion (Misc queries) 2 December 6th 06 10:14 PM
Need to delete last value in column but not delete entire row [email protected] Excel Programming 4 October 19th 06 05:26 PM
Delete Entire Row If Q John Excel Programming 10 June 9th 04 03:02 PM
Another delete entire row Sean[_9_] Excel Programming 1 May 11th 04 04:41 PM


All times are GMT +1. The time now is 04:00 PM.

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"