NewbieNoob
New Member
- Joined
- Feb 23, 2018
- Messages
- 15
Code:
Private Sub Button_Click()
On Error Resume Next
Dim Dept_Row As Long
Dim Dept_Clm As Long
NewTable = NewSheet.Range("A2:A10")
DataTable = DataSheet.Range("A2:B10")
Dept_Row = NewSheet.Range("B2").Row
Dept_Clm = NewSheet.Range("B2").Column
For Each Cl In NewTable
NewSheet.Cells(Dept_Row, Dept_Clm) = Application.WorksheetFunction.VLookup(Cl, DataTable, 2, False)
Dept_Row = Dept_Row + 1
Next Cl
End Sub
I have a new sheet simply called NewSheet. In column A, I want to input some values, and then have it look at a different sheet called DataSheet, then look up the values in column A on that sheet, then match the values and copy the values from column B in DataSheet over to column B in NewSheet.
Last edited: