+ Reply to Thread
Results 1 to 12 of 12

Find Row Number and Copy it to Adjacent Cell

  1. #1
    Registered User
    Join Date
    07-01-2014
    Location
    Kolkata
    MS-Off Ver
    2013
    Posts
    28

    Find Row Number and Copy it to Adjacent Cell

    i hv two sheets, sheet1 has some data in j2 to j27 and they hv some value in l2 to l27. i need to lookup each cell value of column J into sheet2 column E. if match find row and past value of sheet1 column L into sheet2 column H. new to vba. i write some code but........Untitled.png

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Find Row Number and Copy it to Adjacent Cell

    You have provided just bits and pieces of the information needed to answer your question.

    I assume you are showing us where the code stops for a runtime error. When showing an error, always show the error message.

    With the information you have provided my only guess is that Rng1 is Nothing, meaning that strToFind was not found in Rng. What do you want the code to do if the string is not found?

    For a more complete diagnosis, please attach your file with instructions for how to run your macro. The paper clip icon does not work for attachments. To attach a file, under the text box where you type your reply click the Go Advanced button. On the next screen scroll down and click on Manage Attachments, which will show a pop-up window to Select and Upload a file. Then close the window.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    07-01-2014
    Location
    Kolkata
    MS-Off Ver
    2013
    Posts
    28

    Re: Find Row Number and Copy it to Adjacent Cell

    Hi,
    attached file as u ask for
    Last edited by asqw; 09-16-2019 at 08:36 AM.

  4. #4
    Registered User
    Join Date
    07-01-2014
    Location
    Kolkata
    MS-Off Ver
    2013
    Posts
    28

    Re: Find Row Number and Copy it to Adjacent Cell

    Hi
    i hv already post the file

  5. #5
    Valued Forum Contributor
    Join Date
    02-02-2016
    Location
    Indonesia
    MS-Off Ver
    Office 365
    Posts
    1,004

    Re: Find Row Number and Copy it to Adjacent Cell

    You should Dim Rng1 as Range not variant.

  6. #6
    Registered User
    Join Date
    07-01-2014
    Location
    Kolkata
    MS-Off Ver
    2013
    Posts
    28

    Re: Find Row Number and Copy it to Adjacent Cell

    i did but same result Error 91

  7. #7
    Valued Forum Contributor
    Join Date
    02-02-2016
    Location
    Indonesia
    MS-Off Ver
    Office 365
    Posts
    1,004

    Re: Find Row Number and Copy it to Adjacent Cell

    I can't test Sub EditRate because sheets ProData don't exist in your sample file.

  8. #8
    Registered User
    Join Date
    07-01-2014
    Location
    Kolkata
    MS-Off Ver
    2013
    Posts
    28

    Re: Find Row Number and Copy it to Adjacent Cell

    sorry,
    i attach again
    Attached Files Attached Files

  9. #9
    Valued Forum Contributor
    Join Date
    02-02-2016
    Location
    Indonesia
    MS-Off Ver
    Office 365
    Posts
    1,004

    Re: Find Row Number and Copy it to Adjacent Cell

    If 'strToFind' has no match then Rng1 will be nothing, that's what cause the error.
    Try this:

    Please Login or Register  to view this content.

  10. #10
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: Find Row Number and Copy it to Adjacent Cell

    Your two Budweiser product names on data sheet are spelled differently therefore cannot be found

  11. #11
    Registered User
    Join Date
    07-01-2014
    Location
    Kolkata
    MS-Off Ver
    2013
    Posts
    28

    Re: Find Row Number and Copy it to Adjacent Cell

    Thank You
    what would be if Rng1 is FALSE then display MsgBox and continu with Next

  12. #12
    Valued Forum Contributor
    Join Date
    02-02-2016
    Location
    Indonesia
    MS-Off Ver
    Office 365
    Posts
    1,004

    Re: Find Row Number and Copy it to Adjacent Cell

    Try:

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. VBA Code to Find Row Number and Copy it to Adjacent Cell
    By theteerex in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-30-2018, 12:50 PM
  2. Formula; Find a SKU and copy the adjacent cell
    By ccwbass in forum Excel General
    Replies: 1
    Last Post: 04-06-2017, 01:56 AM
  3. Find then Replace Adjacent Cell with New Number
    By n0mad in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 01-28-2017, 08:44 PM
  4. Find a number and replace the adjacent cell with other number
    By shafath03 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-20-2013, 09:09 PM
  5. copy a specif cell value, find another like that in sheet copy adjacent cell and pate
    By smwaqas89 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-16-2013, 10:00 AM
  6. Find data and copy adjacent cell
    By hockeyadc in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-10-2012, 02:35 PM
  7. [SOLVED] Find Cell and Copy adjacent value to another location
    By JJalomo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-08-2005, 04:06 PM

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