VBA/Macros in Cell Edit mode / Formula text selectio

  • Thread starter Thread starter bulk88
  • Start date Start date
B

bulk88

Why doesn't a macro run when I am in cell edit/formula edit mode? How
can i get one to run in Cell edit mode?

Also, how can I get what a user highlight/selected with a mouse or
shift+arrow keys in VBA?

The Selection Object in Excel seems to only work on Cells, not Cell
contents/text/formulas.
 
Answer to first question is that macros do not run while in cell edit mode.

Second question:-
ActiveCell.Value returns the value of the selected cell. Because Value is
the default you may simply use ActiveCell to return the value of the cell.

ActiveCell.Formula returns the formula that is in the selected cell.

Examples:-
'to return the value of the active cell in a message box.
MsgBox "Activecell = " & ActiveCell

'To return the formula in the active cell in a message box.
MsgBox "Activecell = " & ActiveCell.Formula

To get the syntax for placing values and formulas in cells using a macro,
try recording macros to do it.

Regards,

OssieMac


Ms
 
Back
Top