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

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.



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default creating a loop

Look in the vba help index for FINDNEXT. Good example to modify

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Bradly" wrote in message
...
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.




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
creating a loop JakeShipley2008 Excel Discussion (Misc queries) 2 September 9th 08 02:17 PM
Creating a loop Jennifer Excel Programming 11 April 6th 08 02:02 AM
Need Help With Creating A Loop zero635[_8_] Excel Programming 3 October 29th 05 08:58 PM
Creating a loop Ibuprofen Excel Programming 1 October 26th 05 04:41 AM
Creating a For Loop Justin Ragsdale Excel Programming 5 May 23rd 04 10:40 PM


All times are GMT +1. The time now is 09:40 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"