creating a loop

B

Bradly

I have a spreadsheet called "550+ list". It contains a long list of clients
who have cases at a 550 or higher level, each client also having a different
month that the case needs to be reviewed. So, my current list has review
months that are not in chronological order.

I have written a simple macro (as I am a beginner using macros) to find the
first instance of, for example, cases that need a review in September (listed
as "9/30/2009"). I have a sheet in the same workbook entitled "September"
where I want to list all cases that have a review date of "9/30/2009". The
macro finds the first instance of September reviews and pastes the case
information on the September sheet--that part is fine.

I would like to know how to loop the macro, because I do not know how many
cases will need September reviews. The problem I might encounter is that if
I used the ctrl+F key manually to see every case with a September review,
eventually that key would go back to the first instance found, and I don't
want to paste duplicate listings of the cases (just one instance of all
September cases).

Here is the part of the macro that I want to repeat:

Sheets("550+ List").Activate
Cells.Find(What:="9/30/2009", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
Cells.FindNext(After:=ActiveCell).Activate
Selection.Offset(0, -6).Range("A1:G1").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("September").Activate
ActiveCell.Offset(rowOffset:=1, columnOffset:=0).Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False

Can anyone help me to understand a simple way of making this loop?
Thanks.
 

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

Similar Threads


Top