Macro that presses Enter key on active cell

omairhe

Well-known Member
Joined
Mar 26, 2009
Messages
2,040
Office Version
  1. 2019
Platform
  1. Windows
if the active cell is T3... what code that would work exactly like a Enter key is pressed on T3...Not looking for ActiveCell.Offset(0, 1).Range("A1").Select


any help will be appreciated.
thank you.
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
the cell moves to the adjacent cell. but u might think y not just use ActiveCell.Offset(0, 1).Range("A1").Select

the cell adjacent is not a regular cell but has a combo box inside of it via code.

and combo box only is active when i click or press Enter or Move arrow key on combo box cell. but if i do the same with macro it just moves to the underneth cell and doesn't select the combo box which usually gets selected if not use macro.

hope its clear... :)
 
Upvote 0
U3 has combo box and T3 is adjacent.... pressing right arrow key or Enter key from T3 moves to U3 and selects the combo box... offset macro selects only U3 Cell not the combo box that is inside U3...

will appreciate help
 
Upvote 0
That's only true if the "Move selection after Enter" option is checked.

You could try:

SendKeys "{Enter}"

If that doesn't work what is the name of your ComboBox and where is it from (Control Toolbox or Forms Toolbar)?
 
Upvote 0
That's only true if the "Move selection after Enter" option is checked.

You could try:

SendKeys "{Enter}"

If that doesn't work what is the name of your ComboBox and where is it from (Control Toolbox or Forms Toolbar)?

My combobox is an Active X Controls from excel 2007 and your code worked :)

THanks Sir.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,213,551
Messages
6,114,266
Members
448,558
Latest member
aivin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top