ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Help with row selection. (https://www.excelbanter.com/excel-programming/314003-help-row-selection.html)

Drrott1

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


Don Guillett[_4_]

Help with row selection.
 
As always, copy/paste your coding efforts here for comment.

--
Don Guillett
SalesAid Software

"Drrott1" wrote in message
...

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 a
input box to have the user insert text to search for what they need. I
can get it to return the value of the row it finds the first case
(There are several). I can also get it to find the last case of it
along with the row but how do I select these rows, and the rows
inbetween so I can copy them to another sheet to further filter out
which information I need?


I hope I was able to explain my problem

Craig Schellenbach

Aim: Drrott1


--
Drrott1
------------------------------------------------------------------------
Drrott1's Profile:

http://www.excelforum.com/member.php...o&userid=15460
View this thread: http://www.excelforum.com/showthread...hreadid=270489




David Holtby[_3_]

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



All times are GMT +1. The time now is 04:20 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com