Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simulate F2 in code

Status
Not open for further replies.

dar149

MIS
Mar 5, 2002
117
US
Does anyone know how to code F2 and then Enter feature in VBA? I tried recording, but it doesn't produce the same result. I have a cell that contains 13 numbers. I have the field coded as text because the number originally has dashes and spaces, which I delete. When the number is redisplayed, it comes up with E+11 at the end instead of the entire number, so the search fails. I can't create a custom format, because the length of the number varies. When the number displays with the E+11 notation and I hit F2 and Enter the notation disappears and the number is fully displayed.

Thanks for any help...
 
Just format as General. Macro record and implement.

Skip,
[sub]
[glasses] [red]Be advised:[/red] Researchers have found another Descartes trueism, "Cogito ergo spud."
"I think; therefore, I YAM!
[tongue][/sub]
 
I can't create a custom format
Even just "#" ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
This is the number I start with: 2.56307E+11. When I format as general and hit F2, then Enter, the number still displays as above. When formatted as text and do the same the number displays as 256306951160, which is what I need displayed.

Thanks...
 
Just out of curiosity, how are you removing the "dashes and spaces".

after you remove them, is the cell still formatted as text?

Do you then attempt to format the cell as General?

Have you tried formatting it as a number with no decimals?



Peace!! [americanflag] [peace] [americanflag]

Mike

Didn't get the answers that you wanted? Then . . . Click Here
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top