• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Change VBA Code to show Forms

Jet Fusion

Member
Hi All

Is there a way to change this code to call for the built in Excel Forms function from another sheet1 (Dashboard) not the sheet3 that contains the table (cell B2)?

Code:
Sub OpenDataEntryForm()
    Dim nName As Name
    Range("B2").CurrentRegion.Name = "database"
    ActiveSheet.ShowDataForm
    For Each nName In ActiveWorkbook.Names
       If "database" = nName.Name Then nName.Delete
    Next nName
End Sub

Thanks in advance

Jet
 
Hi,​
to load the Excel built-in form just obviously replace ActiveSheet with the appropriate worksheet reference …​
 
Hi @Marc L

I did try that, but I get an error. The Data sheet is on another sheet3 and the sheet I want to use for opening the form is on sheet1 am using an icon with the macro to excute. See attached error, once I debug it highlights the
Code:
 Sheet1.ShowDataForm
.
 

Attachments

  • Error.PNG
    Error.PNG
    97.9 KB · Views: 8
Or you did something badly as this method never failed on my side since last century !​
According to any forum rules post at least an attachment with a crystal clear complete elaboration of your context and need …​
 
In this century I have no clue what you just said!!!

Oh did I not give a crystal clear complete elaboration of my context and need ... in post #1?

Anyway thanks for your help!
 
In more than 20 years so since last century - for the good enough readers ! - I never met any issue with this method, very reliable.​
Without what any forum expects in the initial post, your thread is just a guessing challenge but as I won't guess anything …​
 
Thanks @Debaser, it half worked with your suggestion after still getting the same error I figured out that I had a cell (B2) not table (Table1) as a reference :po_O
 
Back
Top