Do While and xlDown?

deathmastar0

New Member
Joined
May 30, 2012
Messages
1
I have a pretty big task in mind, and I'm stuck on a lot of parts. I've outlined it below:

1. search for a specific phrase in the spreadsheet (exact phrase, match entire cell contents). Store its index.

This is easy enough:
Code:
Cells.Find(What:="Vendor Terminal p/n", After:=ActiveCell, LookIn:= _        xlFormulas, LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:= _
        xlNext, MatchCase:=True, SearchFormat:=False).Activate
index = activecell.row
2. Use a Do While loop to find the index of the last non-empty cell in the range (index to the end of the column). Call it index2.

This is the part that's giving me troubles; I'm pretty sure that I should use Do While and xlDown, but I'm not at all sure HOW to implement this. Anybody have suggestions? I appreciate it!

3. Use this range to select the items in the column between the first index and the second index, and then copy the data in this range to a new spreadsheet. Save this spreadsheet as 'doc1.xlsx.'

4. Repeat the process, except now APPEND the items in the range to doc1.xlsx.
 

Forum statistics

Threads
1,082,585
Messages
5,366,466
Members
400,892
Latest member
lamarh755

Some videos you may like

This Week's Hot Topics

Top