HI There,
Need Urgent Help to Build a Code for one Work project workbook
I need that once cell value Matched then Copy and paste the Cell value from one sheet to another
Like in the attached file Sheet 1 Cell "D5" with matched with Sheet 2 range (A4:A7)(List of Name or EMail id ) then copy the value from Sheet 1 Cell ("C9", "E9","G9") a specific cell & paste to a specific cell In Sheet to with the same line where Sheet 1 D5 value matched
Like Below Example
Sheet 1 Cell value is "Rajesh"
In Sheet 2 Once the value is matched then on the same line a specific cell ("B5","D5","F9") value should paste
I already tried Below Code but unable to paste on require cells
Sub findAndCopy()
Dim foundCell As Range, sh1, sh2 As Worksheet
'Set sheets
Set sh1 = Sheets("Test-01")
Set sh2 = Sheets("Test-02")
'Find string in column C of Sheet2
Set foundCell = sh2.Range("A2:A5").Find(sh1.Range("D5").Value, , xlValues, xlWhole)
If Not foundCell Is Nothing Then 'If match cell is found
sh1.Range("C9", "E9").Copy
foundCell.PasteSpecial xlPasteValues
foundCell.PasteSpecial xlPasteFormats
Application.CutCopyMode = False
Else
Call MsgBox("Not found the match cell!", vbExclamation, "Finding String")
End If
End Sub
Bookmarks