+ Reply to Thread
Results 1 to 7 of 7

Matching data between two sheets

  1. #1
    Registered User
    Join Date
    08-27-2014
    Location
    Lisboa, Portugal
    MS-Off Ver
    2007
    Posts
    24

    Matching data between two sheets

    Hello!
    I am trying to come up with a code that does the following things:
    I have two sheets, sheet "RESUMO" and sheet "Gran.Solos NLT 10491".
    Each sheet has a cell named "Sample" next to which the sample number is written.
    In sheet resumo there is a column full of sample numbers, and I need for the other sheet to find the row with the same sample number it has and copy the information on the cell from that row and column G, and paste it on cell B4 from the other sheet.
    Please Login or Register  to view this content.
    This code does nothing, can anyone help me fix it? Thanks
    Last edited by JBeaucaire; 09-10-2014 at 02:25 AM. Reason: Added Code Tags / Corrected title. Please read and follow the forum rules! Link above in the menu bar.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Need help fixing code

    Hello MariPip,

    Change this line of code:
    Please Login or Register  to view this content.
    To this ...
    Please Login or Register  to view this content.
    The Cells object takes a Row argument (Long) and a Column argument (Variant). The row must be a number and the column can be either a number or a letter.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    08-27-2014
    Location
    Lisboa, Portugal
    MS-Off Ver
    2007
    Posts
    24

    Re: Need help fixing code

    Thank you, but I arleady did that and itīs not working. It bugs on "If target.Value = sh2.Cells("B4").Value Then" with the error message :"Aplication-defined or object-defined error"
    Last edited by MariPip; 09-09-2014 at 04:31 PM.

  4. #4
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Need help fixing code

    Please Login or Register  to view this content.
    The format in the first half of that line is also incorrect.

    The alternate with cells would be

    Please Login or Register  to view this content.
    or

    Please Login or Register  to view this content.
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

  5. #5
    Registered User
    Join Date
    08-27-2014
    Location
    Lisboa, Portugal
    MS-Off Ver
    2007
    Posts
    24

    Re: Need help fixing code

    It still bugs on the same sentence

  6. #6
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Need help fixing code

    Hello MariPip,

    You will need to post a copy of your workboook for review.

    Please redact any sensitive or confidential information before you upload the workbook.

    How To Post Your Workbook
    1. At the bottom right of the Reply window, Click the button Go Advanced
    2. At the top of the Your Message Window, in the first row of icons, Click the Paperclip icon.
    3. Click the Add Files button at the top right in the dialog box. This displays the File Manager dialog.
    4. Click the Select Files button at the bottom middle of the dialog.
    5. In the new window Find the file you want to upload, select it, and Click Open.
    6. You will now be back in the File Manager dialog. Click the bottom Middle button Upload File.
    7. Wait until the file has completely uploaded before you exit the File Manager dialog.

  7. #7
    Registered User
    Join Date
    08-27-2014
    Location
    Lisboa, Portugal
    MS-Off Ver
    2007
    Posts
    24

    Re: Need help fixing code

    There you go , I really hope you can help me
    Attached Files Attached Files

+ 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. Fixing worksheet_change code
    By MariPip in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-29-2014, 08:16 PM
  2. Need HELP fixing this code
    By Dewbo in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-29-2014, 09:16 AM
  3. [SOLVED] Fixing the VBA code
    By brownie4321 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-24-2012, 09:35 AM
  4. VBA code for Hyperlink fixing
    By narendra1302 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-18-2010, 06:01 AM
  5. fixing code
    By timmy64 - ExcelForums.com in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-04-2005, 04:48 AM

Tags for this Thread

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