+ Reply to Thread
Results 1 to 2 of 2

search function but how do i make it select the entire row

  1. #1
    Registered User
    Join Date
    01-20-2008
    Posts
    26

    search function but how do i make it select the entire row

    Hi,

    I've made the following search script to search for the job no you input but atm it just selects the cell but i want to be able to select the entire row that the number is in and copy it to another sheet.

    Sub FindTheNo()
    Dim JobNoToFind


    JobNoToFind = InputBox("Please enter the value to search for")
    If JobNoToFind = "" Then Exit Sub
    Sheets("Core").Select
    Cells.find(What:=JobNoToFind, After:=ActiveCell, LookIn:=xlFormulas, LookAt _
    :=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
    False).Activate

    ' I don't know how to make it select the row the cell is in from column A to G'
    ActiveRow.Copy




    Sheets("CM").Select
    Cells(13, 2).Select
    ActiveSheet.Paste

    End Sub

  2. #2
    Registered User
    Join Date
    01-20-2008
    Posts
    26

    Solution

    Hi,

    I've solved my own problem, the script is below if anyone is interested.

    Sub FindTheNo()
    Dim JobNoToFind


    JobNoToFind = InputBox("Please enter the value to search for")
    If JobNoToFind = "" Then Exit Sub
    Sheets("Core").Select
    Cells.find(What:=JobNoToFind, After:=ActiveCell, LookIn:=xlFormulas, LookAt _
    :=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
    False).Activate

    ActiveSheet.Rows(ActiveCell.Row).EntireRow.Select
    ActiveSheet.Rows(ActiveCell.Row).EntireRow.Copy

    Sheets("CM").Select
    Cells(48, 1).Select
    ActiveSheet.Paste

    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1