Replacing export with descriptions -Vlookup Macro

  • Thread starter Thread starter Joey
  • Start date Start date
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!
 
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
 
Back
Top