I have little to no VBA experience, but I have developed high level code in the past. I need a simple VBA script for my Workbook that I’m using. I have searched the web for solutions but I haven’t been able to find exactly what I need. I have one Workbook with two worksheets (Ex: Sheet1 and Sheet2).
• Sheet1 has two columns (Column A (contains a Name) and Column B (Contains a Numerical Value). For example:
A B
Smith 1236
Jones 7643
White 2344
Thomas 9022
Greene 5221
Holmes 3287
Jackson 9932
• Sheet2 has multiple columns, but I need to select a single column (for example ColumnJ) in Sheet2. The cells in ColumnJ may or may not contain one of the names in Sheet1/ColumnA. If the name appears in a cell in Sheet2/ColumnJ. I need to replace that name with the Numerical value from Sheet1/ColumnB
A B C D … J … Z
Smith 1236 Data Data Data White Data Data
Jones 7643 Data Data Data Jackson Data Data
White 2344 Data Data Data Wilson Data Data
Thomas 9022 Data Data Data Holmes Data Data
Greene 5221 Data Data Data Black Data Data
Holmes 3287 Data Data Data Jones Data Data
Jackson 9932 Data Data Data White Data Data
Sheeet2 Prior to running VBA script
A B C D … J … Z
Data Data Data Data Data 2344 Data Data
Data Data Data Data Data 9932 Data Data
Data Data Data Data Data Data Data
Data Data Data Data Data 3287 Data Data
Data Data Data Data Data Data Data
Data Data Data Data Data 7643 Data Data
Data Data Data Data Data 2344 Data Data
Sheet2 After Running VBA script
Whilst I do agree with Tim, I'll give you some leway, first post, just try to show some attempt, give us something to manipulate.
try this code: