+ Reply to Thread
Results 1 to 3 of 3

Find word in one cell and copy cell above in other column

  1. #1
    Registered User
    Join Date
    12-13-2010
    Location
    Brazil
    MS-Off Ver
    Excel 2003
    Posts
    26

    Find word in one cell and copy cell above in other column

    Hello, I have a problem that's probably very simple to solve:

    I want a macro that searches for the word "NF" (without quotes) in column B. If true, than for that row for the columns D to AV, it should copy the value of the cell above.

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Find word in one cell and copy cell above in other column

    Hi, kurtwagner,

    you could either use Find which would deliver a Range-Object if the searched item is found (and the use the row of that range to build the range to copy the values, you may refer to the VBA-Help on that topic) or Application.Match which would either deliver an error or the row number which then could be used as before.

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Find word in one cell and copy cell above in other column

    hi kurtwagner. there are many assumptions & questions involved here, so i suggest you upload a sample Excel file for us to help you better.

    1. which column is sure to be filled (so that i can identify the last row)?
    2. which row do you start in?
    3. do you want to find the exact word "NF" or whether the cell contains "NF"?
    4. if row 2 & 3 contains "NF", row 2 will be based on row 1's data & row 3 on row 2's data? so they actually all have the same data for this case?

    for exact word:
    Please Login or Register  to view this content.
    for finding cell that contains "NF":
    Please Login or Register  to view this content.
    assumptions were that i can find last row in column B & data starts from row 2

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

+ 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