How to activate "new" tab in Dataform in EXCEL through VB

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
Code:
Range("A1").Select
ActiveSheet.ShowDataForm

The above code shows up the dataform in an excel worksheet. But how it can
be written in such a way so that the data form is ready to accept new
record.(Or like the "New" tab clicked.) I hope the question is clear.
 
Maybe something like:

Option Explicit
Sub testme()

SendKeys "%w"
Application.DisplayAlerts = False
ActiveSheet.ShowDataForm
Application.DisplayAlerts = True

End Sub

(The shortcut for a New record is alt-w (%w in Sendkeys syntax).)
 
Thanks A lot Dave.
I was trying to get an answer for this for quite sometime. As I am new to
this forum I had made a mistake of posting the same question twice. Sorry for
that. Your work is well appreciated.
 

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