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!

F2 Equivalent Function / Method in Excel

Status
Not open for further replies.
Jun 24, 2005
109
GB
Hi all,

I'm using in built validation within Excel to manage some user responses. However, What happens is that when somebody completes cell A1 (for example), they are automatically forwarded to D8. This is easy to achieve, but I want them to be already in the cell for editing (i.e. the equivalent of pressing F2 on the cell).

All I can do currently is activate cell D8 and then sendkeys F2. It does have the desired affect, but I would really rather avoid send keys wherever possible.

Any idea?

Regards

Matt
 


Hi,

"but I would really rather avoid send keys wherever possible."

Why?

Skip,

[glasses] [red][/red]
[tongue]
 


If you REALLY want to force the user in such a rigid way, use a Textbox and Button.

Skip,

[glasses] [red][/red]
[tongue]
 
Skip - I know the scenario behind this.

The requirement is that after a user has changed a value in a range, they are directed to a cell further along in the same row. The business requirement is to have the cell be in edit mode so that the user can type straight into the appropriate cell (this is for a survey for Field Sales staff to fill in and they are incredibly good at putting data in the worng place)

I think the aversion to Sendkeys is the unpredicatability of using it where you are not 100% sure of what is happening on the user's computer - it is not tied to excel or the process in hand and can therefore give unexpected results

Sendkeys could be used. The question is whether there is any alternative. Personally, I don't think there is (not without some kind of API call anyway) but that's why the question was posted

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Geoffs right in terms of requirement. The sendkeys method does work but it has a couple of issues. Firstly it can be a bit unpredictable, secondly if I get problems you cant step through the code to find the issue.

I could have used a text box, and validated it myself I guess, but I was also quite interested to see if there was a way to do what I was asking.

Cheers

Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top