VBA to simulate the enter button?

  • Thread starter Thread starter Bob O
  • Start date Start date
B

Bob O

Hello All,
I was wondering if there is a way to write vba code that would simulate
the enter button being pressed at set time intervals? Right now I have
to hit the enter button for my changes to take affect in Excel but I
really need this to be automatic.

Any help is appreciated,
Bob O
 
Do you mean in response to something a macro is doing, or just
clicking "OK" during normal interactions with Excel?

Maybe you could provide a specific example of what you would like to
happen.

Tim
 
Tim,
Thanks for the reply. I have a macro that runs every 5 sec. that takes
data from and Access table and places it in to an Excel worksheet. I
then need to send this out to a PLC on our production floor for quality
inspection reasons. Right now I am simulating our scheduling software by
typing in the data manually and I have to hit enter and then going into
the excel spread sheet and hitting enter before all the updates work. I
am hoping that I can place a number in the access table without hitting
enter and have a VBA macro simulate the enter button in both Access and
Excel.

Hope this makes more sense,
Bob O
 
Bob O said:
Tim,
Thanks for the reply. I have a macro that runs every 5 sec. that takes
data from and Access table and places it in to an Excel worksheet. I
then need to send this out to a PLC on our production floor for quality
inspection reasons.

"Send" means what? How is the data being sent?
Right now I am simulating our scheduling software by
typing in the data manually and I have to hit enter and then going into
the excel spread sheet and hitting enter before all the updates work. I
am hoping that I can place a number in the access table without hitting
enter and have a VBA macro simulate the enter button in both Access and
Excel.

What are you "hitting enter" on? Do you mean you are responding to
dialogs/messagboxes with (eg) OK/Cancel buttons? If so, what questions are
the dialogs asking?

To update the access table "without hitting enter" you could look into using
a macro from Excel, but I'm not sure why you wouldn't just enter this number
directly in excel instead of first putting it in Access only to have Excel
query it back out.....

More explanation is needed.

Regards,
Tim.

--
Tim Williams
Palo Alto, CA
 

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

Back
Top