ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How do I reference the cell address next to Active cell (https://www.excelbanter.com/excel-programming/291590-how-do-i-reference-cell-address-next-active-cell.html)

Nico Le Roux

How do I reference the cell address next to Active cell
 
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



Frank Kabel

How do I reference the cell address next to Active cell
 
Hi
to reference the cell next to the active cell you may use
activecell.offset(0,1).value = your_lookup_value

--
Regards
Frank Kabel
Frankfurt, Germany

Nico Le Roux wrote:
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



Bob Phillips[_6_]

How do I reference the cell address next to Active cell
 
Hi Nico,

In VBA?

Set oFound = Worksheets("Sheet2").Range("A1:A100).Find(Acivecel l.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)

"Nico Le Roux" wrote in message
...
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





Tom Ogilvy

How do I reference the cell address next to Active cell
 
activecell.offset(0,1).Value = ActiveCell.Value +
Application.Vlookup(activeCell.Value, _
Worksheets("Sheet2").Range("A1:A200"),2,False)

--
Regards,
Tom Ogilvy

"Nico Le Roux" wrote in message
...
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





Nico Le Roux

How do I reference the cell address next to Active cell
 
Thks Frank and Tom.

"Nico Le Roux" wrote in message
...
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





Alan Beban[_4_]

How do I reference the cell address next to Active cell
 
An alternative, probably faster, to ActiveCell.Offset(0,1) is
ActiveCell(1,2)

Alan Beban

Nico Le Roux wrote:
Thks Frank and Tom.

"Nico Le Roux" wrote in message
...

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








All times are GMT +1. The time now is 05:37 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com