F2 (Edit) and Enter

J

Jim May

Is there a VBA equivalent to doing this..

select a cell F2 into Edit mode - and Press enter Key

Is there a VBA Eqiv? If so, what code line(s)?
 
D

Dave O

It sounds like you may be trying to emulate keystrokes in VBA, which
is possible to an extent. When it comes to editting a text string or
formula there are better ways to do it, such as MID, LEFT, RIGHT, etc.

Please give an example of what you're trying to do, with "before" and
"after". Also, please give an idea of how standardized the data is, if
any- along the lines of "the area code is always in parentheses" or
"the string length always varies".

Dave O
Eschew obfuscation
 
J

Jim May

Let's say I've just formatted a true number 123 as text (in Cell A1).
Before it was right justified. Afterwards it is left justified.
But I need to "refresh it by doing the F2, Enter on cell A1.

With a Macro (VBA) assigned to a button I would just have to click the
button.
 
J

JP

How about

Sub EnterSomething()
Dim R As Range
For Each R In Worksheets("Sheet1").Range("A1:A10") ' or For
each R in Selection
R = R.Value
Next R
End Sub



HTH,
JP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top