Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help with row selection.
I cannot seem to find a solution to this. I am sure there is one. I have a data file that I import into excel and I am able to create input box to have the user insert text to search for what they need. can get it to return the value of the row it finds the first cas (There are several). I can also get it to find the last case of i along with the row but how do I select these rows, and the row inbetween so I can copy them to another sheet to further filter ou which information I need? I hope I was able to explain my problem Craig Schellenbach Aim: Drrott -- Drrott ----------------------------------------------------------------------- Drrott1's Profile: http://www.excelforum.com/member.php...fo&userid=1546 View this thread: http://www.excelforum.com/showthread.php?threadid=27048 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help with row selection.
This may not be terribly elegant but it works: Create a worksheet that you will eventually hide. Name a cell on this worksheet “CountOfSearch” At the point in your code immediately after you have selected the rang you are searching: 1. Name the range using the ApplyNames method 2. Count the number of times the search text appears in the range usin the following formula: Range(“CountOfSearch”).value "=COUNTIF(Range(“SearchRange”),SearchCriteria) " Counter= Range(“CountOfSearch”).value where SearchCriteria is the variable generated by your input box 3. Then use a Do Loop to iterate through the selected range for numbe of iterations = Counter In each iteration you can copy/paste the row to another workshee (remember to move the row in the destination sheet down 1 row eac time! Hope this help -- David Holtb ----------------------------------------------------------------------- David Holtby's Profile: http://www.excelforum.com/member.php...fo&userid=1540 View this thread: http://www.excelforum.com/showthread.php?threadid=27048 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Limiting selection in a cell AND linking that selection to a list | Excel Discussion (Misc queries) | |||
Copy Selection - Transpose Selection - Delete Selection | Excel Discussion (Misc queries) | |||
Identifying a selection of a selection of a range | Excel Worksheet Functions | |||
limit cell list selection based on the selection of another list | Excel Worksheet Functions | |||
Excel VBA - Range(Selection, Selection.End(xlDown)).Name issue. | Excel Programming |