+ Reply to Thread
Results 1 to 3 of 3

Is Error + Match and replace adjacent row

  1. #1
    Registered User
    Join Date
    12-03-2014
    Location
    Manchester, England
    MS-Off Ver
    2007
    Posts
    23

    Question Is Error + Match and replace adjacent row

    Hello everyone,

    I am new in the forum and in I've been working with VBA only for a couple of month. I need your help with an issue (probably an silly one).

    I have one list of parameter on one sheet (sheet1) and in another sheet (sheet2) I have another list with only some parameters. What I need is to match values from the two lists and return an adjacent value from sheet2 to sheet1. In sheet1 the parameters are in column A and in sheet2 the parameters are in row 2. Until now I have this:

    Sub Macro()

    On Error Resume Next
    For Repeat = 5 To 2884
    With Range("B" & Repeat)
    If Not (IsError(Application.Match(.Offset(0, -1).Text, Sheets("Matrix").Rows(2), 0))) Then
    .Value = "-"
    End If
    End With
    Next Repeat

    End Sub

    It works perfectly but the only problem is that returns the value = "-" and what I want is to return the values in row 3 from sheet 2 where the parameters match, like using an ActiveCell.Offset(,0) (something like that). I tried everything and nothing. I know that probably it is easy but I am new in this world and I hope you can help.
    I hope I explained clearly enough.

    Cheers guys!
    Ed

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Is Error + Match and replace adjacent row

    I made a few changes. You should be able to identify them.

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    12-03-2014
    Location
    Manchester, England
    MS-Off Ver
    2007
    Posts
    23

    Re: Is Error + Match and replace adjacent row

    Thanks mate. It is done!

+ 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. Macro to compare text in ranges to find match and replace with adjacent value.
    By 54ed in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-11-2013, 06:44 PM
  2. [SOLVED] Match one cell with another, if match found copy adjacent cells
    By Xiophoid in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-07-2013, 05:50 AM
  3. [SOLVED] Match text in 2 columns, if true output adjacent cell to the match.
    By kenoboy in forum Excel General
    Replies: 3
    Last Post: 07-03-2012, 09:52 AM
  4. match value in one column to adjacent value: use vlookup or index/match?
    By conorsgaffney in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-28-2010, 04:59 PM
  5. Find, Replace with and then replace adjacent cell
    By Craig2097 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-18-2009, 12:42 PM

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