If I understand you problem correctly, the answer is quite straight-forward.
decalre a variable and store the name (using your example). Decalre this variable globally if it is going to be used in several subroutines.
Now, when reading you data source, you can compare the name on the row you are processing and compare that to the stored name, extract the date if the same, or if different, process the change and store the new name in the variable.
But...
I also suspect you want to ignore names you have already processed. I would go one of 2 ways here.
First, you could decalre your variable as an array (dim astrnames(100) as String). You could decalre a pinter (Dim intPointer as Integer) to the name you are currently processing. When the name changes, a quick loop around the array to check that trhe name hasn't alreay been encountered. For example:
booFound = False
For intCount = 0 to intPointer-1
If activecell.value = astrNames(intCount) then
booFound = True
...
End if
Next intCount
OR
Still use the array idea above. When a new name is encountered in the array use the workbooks.add to create a new workbook, and add the name to the array. When an existing name is found in the array, use the value of intCount to determine which workbook in the collection is relevant. For example:
Workbooks(inCount).Sheets("Sheet1").Activate
This second methoid has the advantage that you can process each name in the raw data as you encounter it, you don't need multiple passes through the data, and this will decarease the overall time taken to process the data.
Hope this makes sence, and helps!
Art
Bookmarks