Replacing export with descriptions -Vlookup Macro

J

Joey

I have a monthly report that I export from an old system.
Column A contains a number and I have been using VLookup to reference the
description of the number from Worksheet2 Column A, B with Column B listing
the description.

Is there a way of creating a macro to do this? If so, will I still have to
create an empty column for the result or can the macro replace the data in
the cell?

Thanks!
 
S

Shane Devenshire

Hi Joey,

You can write a macro. The macro could replace the cell containing the
number. Something like this:

Sub mytest()
For Each cell In Selection
cell.Value = WorksheetFunction.VLookup(cell,
, 2, False)
Next cell
End Sub

Where Table is the range name of the table on Worksheet2.

Cheers,
Shane Devenshire
Microsoft Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

VLOOKUP formula? 12
Index match with multiple criteria(different than usual) 3
Speek cells, barcode scanner 3
Vlookup or similar 7
help with a vlookup 2
vlookup from right to left 2
Vlookup 1
VLookup Function HELP 7

Top