excel - Find and select multiple rows -


How do I find a column for a lesson and select all the columns and rows that match the search call?

Sample Table:

  Cola ColB ColC ColD Row1 Bob Row 2 Jane Row 3 Joe Row 4 Joe Row 5 Jack Row 6 Jack Row 7 Jack Row 8 Peter Row 9 Susan  

After Marco searches for "Jack", she should select all lines 5-7 in Cola-D.

i finished something different than my question

This macro will search on each row in the source sheet and copy it to target the sheet, which is the parameter that does not need to sort the data, but it makes Marco's runtime longer You can fix this by comparing the previous row searched for a different value than before. The target sheet should be present and any data will be overwritten (it is not possible to undo!)

  Sub Search_SelectAndCopy (string as sheet) Dim SheetData String Dim as DataRowNum Integer in SheetRowNum, SheetData = "//" in the source sheet to search the sheet name: DataRowNum = 2 // 'Start searching on line 2 sheetRON = 2 //' "Sheetcade" in line 2 Start saving data in // 'Select Showtime, as it appears. Requires at glomerate allow copy! Worksheet (Sheetadata) Select / 'Find and copy data, while not (cells (Detroit, 2)) //' until loop column B becomes empty '// Find in our column column B for value, which is similar The name of the target sheet "Chatam" if the range ("B" and CSRR (Detarvanum)) value = Sheetan then // Choose the entire line of lines (CSRR (Detarvanum) and ":" and CSRR (Detarvanam). Select the selection. Copy // Select the target sheet to store the data "Sheetam" and paste the next line sheet (sheet). Choose rows (CSRR (Sheetrov) and ":" and CSRR (SheetROON) Paste SheetRoEnm = SheetRion + 1 // Select 'Move to Front Line' // Source Sheet "Sheet Data" so that sheets can continue. If Data Routinal = Dataraunal + 1 // Find the next line, find 'vend //' and follow the duplicate column style sheets (Sheetam). Columns Finish with the free atifit // 'Top Rubb Sheets (Sheetam) freeze. Selection Range ("A2"). Choose active window. Remove each pair before using frizpanens = true and all  

.


Comments