View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Arnold Klapheck Arnold Klapheck is offline
external usenet poster
 
Posts: 42
Default Replacing Code with words using vlookup

Thank you, that worked

"Vergel Adriano" wrote:

Arnold,

try replacing this line:

MyCell.Value = Application.WorksheetFunctions.VLookup("F" & intcount,
Worksheets("Lookup").Range("$A$4:$B$10"), 2, False)


with this:

MyCell.Value = Application.WorksheetFunction.VLookup(MyCell.Offse t(0, -1),
Worksheets("Lookup").Range("$A$4:$B$10"), 2, False)


--
Hope that helps.

Vergel Adriano


"Arnold Klapheck" wrote:

Update:
A guy at office said must insert column then could hide column with code
words.

So I updated it to:

Dim intLastRow, intcount As Integer
Dim MyCell, MyRng As Range

intLastRow = [F65535].End(xlUp).Row
intcount = 1

Columns("G:G").Insert Shift:=xlToRight

Set MyRng = Range("G1:G" & intLastRow)

For Each MyCell In MyRng

MyCell.Value = Application.WorksheetFunctions.VLookup("F" & intcount,
Worksheets("Lookup").Range("$A$4:$B$10"), 2, False)
intcount = intcount + 1
Next MyCell

can't run the MyCell.Value line says "Object doesn't support this property
or method" any help would be appreciated.