Results 1 to 7 of 7

Matching data between two sheets

Threaded View

MariPip Matching data between two... 09-09-2014, 03:08 PM
Leith Ross Re: Need help fixing code 09-09-2014, 03:59 PM
MariPip Re: Need help fixing code 09-09-2014, 04:25 PM
Solus Rankin Re: Need help fixing code 09-09-2014, 04:28 PM
MariPip Re: Need help fixing code 09-09-2014, 05:12 PM
Leith Ross Re: Need help fixing code 09-09-2014, 05:20 PM
MariPip Re: Need help fixing code 09-09-2014, 06:24 PM
  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.
    Private Sub Worksheet_Change(ByVal target As Range)
    Dim sh1 As Worksheet, sh2 As Worksheet, LR As Long
    Set sh1 = Sheets("RESUMO")
    Set sh2 = Sheets("Gran.Solos NLT 10491")
    LR = sh1.Cells.Find("*", , xlFormulas, xlPart, xlByRows, xlPrevious).Row
    If Not Intersect(target, Range("C27:C" & LR)) Is Nothing Then
    If target.Value = sh2.Cells("B4").Value Then
    sh2.Cells("B5").Value = sh1.Cells("i,G").Value
    Else
    sh2.Cells("B5").Value = ""
    End If
    End If
    End Sub
    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.

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