LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default fixing a loop

I have a sheet with information for 900 clients entitled "550+ List". Each
client has a different month for a case review. For example, clients who
have September reviews have the date "9/30/2009" in the "Next Review" column.

I have come up with a short macro that searches the list for all clients
with, for example, September reviews. When it finds a client with a
September review date, it copies the entire row, and pastes the information
(in columns A:G) on a different sheet entitled "September". It goes through
the entire list fine, with one problem: on the September sheet, the macro
starts pasting information on row 2, which is pasting over the column
headings.

Here is the code I have:

Sub test5()
'
' test5 Macro
'

'
Dim Reviews As Range, Cell As Object
Set Reviews = Range("G3:G900")
For Each Cell In Reviews
If Cell.Value = "9/30/2009" Then
Cell.EntireRow.Copy
Sheets("September").Activate
ActiveCell.Offset(rowOffset:=1, columnOffset:=0).Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
End If
Next

End Sub

I have two questions.
1) How can I get the code to begin pasting on row 3 of the "September" sheet
instead of row 2?

2) Is it possible to change my code so that only columns A:G are copied
instead of the entire row (the copied selection goes way off to the right of
the screen--all I really need are columns A:G)?

Thanks.

 
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
Fixing the size of a row cferon Charts and Charting in Excel 1 July 11th 07 05:54 PM
HELP fixing GPA formula's JohnG Excel Worksheet Functions 7 June 14th 07 06:42 AM
Fixing a sheet tab Brad Setting up and Configuration of Excel 1 February 13th 07 04:01 PM
Fixing the date. cs2883 New Users to Excel 7 October 7th 05 07:40 PM
fixing problem with my tab Zane Excel Discussion (Misc queries) 2 August 6th 05 07:42 PM


All times are GMT +1. The time now is 03:05 AM.

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"