How to bring up blank form

petro62

New Member
Joined
Jul 15, 2013
Messages
17
Thanks to some amazing help on here I am updated my large asset management excel file. With some great macros that were posted on here I was able to accomplish a lot of what I needed including bring up a form for the user to fill in when they want to add a new asset. The issue I have is the form always start pre-filled with the first item on the list which would allow them to overwrite it. Is there a way to make that form start blank?

I guess all I need to know of the code to put in after the following to so it automatically selects the New button on the form which would bring up a blank form then.

VBA Code:
Sub AddNewTag()
'
' AddNewTag Macro
' Click button to get new tag entry form
'

'
    ActiveSheet.ShowDataForm
End Sub
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.

petro62

New Member
Joined
Jul 15, 2013
Messages
17
Hi,
quick search & found same question asked here:VBA - ShowDataForm and add new record
#Post 2 should do what you want

Dave
Yes that worked perfectly thanks

VBA Code:
Sub AddNewTag()
'
' AddNewTag Macro
' Click button to get new tag entry form
'

'
    With Sheets("Tag Name")
        .Select
        Application.SendKeys ("%w")
        DoEvents
        Application.SendKeys ("%w")
        .ShowDataForm
    End With
    Sheets("Tag Name").Activate
End Sub
 

Forum statistics

Threads
1,141,068
Messages
5,704,087
Members
421,326
Latest member
pfaustino

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top