ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How to activate "new" tab in Dataform in EXCEL through VB (https://www.excelbanter.com/excel-discussion-misc-queries/24281-how-activate-%22new%22-tab-dataform-excel-through-vbulletin.html)

shajueasow

How to activate "new" tab in Dataform in EXCEL through VB
 
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.

Dave Peterson

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).)

shajueasow wrote:

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.


--

Dave Peterson

shajueasow

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.

"Dave Peterson" wrote:

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).)

shajueasow wrote:

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.


--

Dave Peterson



All times are GMT +1. The time now is 08:36 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com