Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Vivek Patel   on Oct 20 In MS Office Category.

  
Question Answered By: Jackson Williams   on Oct 20

I'm not sure this addresses the same issue, but could you use the
Find instead?, as in: Set fc = Worksheets("Sheet2").Columns
("A").Find(what:=actVal)

In a VBA form, it might look something like this:

Sub findmatchandmove()

Dim actVal
'<----the variable of the active record to be found
Dim newVal
'<---the variable of the value that needs to be moved
Dim fc
'<---variable for the found cell that matches
Dim fndRrow
'<---variable for the row  that matches
actVal = ActiveCell.Value
'<--- actVal is located in the active cell
newVal = ActiveCell(Offset, 5).Value
'<--- location of newVal, in this example column  5
Set fc = Worksheets("Sheet2").Columns("A").Find(what:=actVal)
'<--finds it on the other sheet
fndRrow = fc.Row
'<--identifies the row it's on in the list
Sheets("Sheet2").Cells(fndRrow, 5).Value = newVal
'<---puts the value in column 5 of the newly found row
MsgBox "Item information is now on Sheet2 on line = " & fndRrow
End Sub

Share: 

 

This Question has 12 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on How to make WorksheetFunction.MATCH OR .VLOOKUP work? Or get search suggestion and latest updates.


Tagged: