How do I reference the cell address next to Active cell

N

Nico Le Roux

My user choose something from the my combo box and the VBA code add the
value to the active cell.

I would like to lookup this value in another range and add the result of the
lookup to the right of the active cell.

Your help would be appreciated.

Regards
Nico
 
F

Frank Kabel

Hi
to reference the cell next to the active cell you may use
activecell.offset(0,1).value = your_lookup_value
 
B

Bob Phillips

Hi Nico,

In VBA?

Set oFound = Worksheets("Sheet2").Range("A1:A100).Find(Acivecell.Value)
If Not oFound Is Nothing Then
Activecell.Offset(0,1).Value = oFound.Offset(0,4).Value
End If

or alternatively

Activecell.Offset(0,1).Value =
WorksheetFunction.VLookup(Activecell.Value,Range("A1:F100,4,False)

Change the ,4 to the offset in the lookup range that you want in both
examples.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
T

Tom Ogilvy

activecell.offset(0,1).Value = ActiveCell.Value +
Application.Vlookup(activeCell.Value, _
Worksheets("Sheet2").Range("A1:A200"),2,False)
 
A

Alan Beban

An alternative, probably faster, to ActiveCell.Offset(0,1) is
ActiveCell(1,2)

Alan Beban
 
Top