+ Reply to Thread
Results 1 to 5 of 5

Macro to find text and if found, copy an adjacent cell into a different cell

  1. #1
    Registered User
    Join Date
    09-19-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    13

    Macro to find text and if found, copy an adjacent cell into a different cell

    Hi All,
    I have been trying to alter various macros for a current problem I am having and so far I have been completely unsuccessful. I require a macro that will look for certain text in a column and then if it finds the text, copy the contents of an adjacent cell into a different cell.

    So the macro checks cells in column A for the text "SC", if it finds SC then it will paste the contents of the cell in column H on the same row as the SC text into a cell that is offset 2,6 so in column N and two cells up.

    I have attached a work book with a rough example if it helps.

    Any help would be greatly appreciated as I have been racking my brains all morning and searching everywhere for a solution.

    Thanks in advance for any help.
    Attached Files Attached Files

  2. #2
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,551

    Re: Macro to find text and if found, copy an adjacent cell into a different cell

    I understand what your wanting to do, but SC is in Column A Row 1 and theres no way to copy Column H to Column N 2 Rows up. So what needs to happen there?
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  3. #3
    Registered User
    Join Date
    09-19-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Macro to find text and if found, copy an adjacent cell into a different cell

    My apologies Mike, please ignore the first SC in A1 the SC text would only be in cells where it would be able to copy to the offset.
    The SC in A1 was meant to be a title but would not be there in the actual spreadsheet, I shouldn't have typed it in A1.

    Thank you

  4. #4
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,551

    Re: Macro to find text and if found, copy an adjacent cell into a different cell

    Ok no problem. Try this

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    09-19-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Macro to find text and if found, copy an adjacent cell into a different cell

    That is perfect, thank you very much for your help Mike.

+ 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