Selecting all cells in all rows and columns after a certain word

drummerpolo15

New Member
Joined
Jan 21, 2014
Messages
0
I would like to select all the values including the one with the word in it. I would like to select all the information in every row and column including the one with the value in it which will be a string and every row/column following that word in that column. in its simplest form i was thinking

If cell value in column A = "test" then select all information in that row and in subsequent rows and columns

I would then like to paste this information into a new sheet.

Thank you all for taking the time to read my question
 

Some videos you may like

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

mumps

Well-known Member
Joined
Apr 11, 2012
Messages
10,097
Assuming that the word is in column A and that the word is "Test", try:
Code:
Sub CopyRange()
    Application.ScreenUpdating = False
    Dim LastRow As Long
    LastRow = Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
    Dim rng As Range
    Set rng = Range("A2:A" & LastRow).Find("Test", LookIn:=xlValues, LookAt:=xlWhole)
    If Not rng Is Nothing Then
        Rows(rng.Row & ":" & LastRow).Copy Sheets("Sheet2").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0)
    End If
    Application.ScreenUpdating = True
End Sub
 

Watch MrExcel Video

Forum statistics

Threads
1,122,224
Messages
5,594,916
Members
413,952
Latest member
JGer

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top