Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Button won't call macro
Have the following code on one sheet, "detail", and want to activate th
Data Form on the "test" sheet, same workbook. Sub Button15_Click() Select Case Application.Caller Case "Button15" Worksheets("test").ShowDataForm End Select End Sub When I debug running to cursor, I get a Run-time error "13", typ mismatch when the cursor is after "showdataform". Thanks in advance. Have Excel 2000........... -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Button won't call macro
Your Select Case statement is unnecessary. Get rid of it. The proble
you're getting comes from the fact that the "form" you created in th worksheet is not a "Form" as we generally refer to in Excel. Go int your VBA editor and on the main menu select Insert--User Form. Wha gets added is something you could make up to take the same information but requires you to add all the fields and titles and buttons yourself From there the information may be placed into the spreadsheet anywher you'd like. The code you would use to call that form is: Form1.Show Though giving it all the functionality you want will be a little (bu not much) more involved. - Piku -- Message posted from http://www.ExcelForum.com |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Button won't call macro
Pikus, Have deleted Case. The data form I want to pull up is th
standard data form you get in Excel from the dropdown "Data" the "Form". The 'test' sheet has the database on it and I want to be abl to add/subtract to the data base with an update button on the 'detail sheet. Deleting Case causes a syntax error with the message "expecting CASE". Code now looks like: Sub Button15_Click() Select Application.Caller "Button_15" Worksheets("test").ShowDataForm End Select End Sub but it won't compil -- Message posted from http://www.ExcelForum.com |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Button won't call macro
I understand. I'm sure there's a way to use that form like you want
but I've never done that. It is possible to create a similar form fro scratch which you can customize to your project and that is what could help you with. In the meantime, loose the select statement al together. Though it will be just as successful, what you've done i exactly the same as this: Sub Button15_Click() Worksheets("test").ShowDataForm End Sub To see what I mean, open your VBA Editor, if the Project Viewer is no visible hit Ctrl + R to open it and click on the project you're workin on. On the main menu click Insert--User Form and a blank form and toolbox will appear. This form can be given any entry fields an layout you want and will be much easier to use for what you have i mind. If you're interested in learning about this say so, I won't g into it otherwise. If not, I'm afraid I don't know how to open th form you're talking about... - Piku -- Message posted from http://www.ExcelForum.com |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Button won't call macro
Pikus: Bingo! Worked right out of the box. No adjustments needed.
Many thanks for taking the time. Lift Of -- Message posted from http://www.ExcelForum.com |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Button won't call macro
|
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Button won't call macro
This works for me
Sub Button15_Click() Worksheets("test").ShowDataForm End Sub -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "pikus " wrote in message ... I understand. I'm sure there's a way to use that form like you want, but I've never done that. It is possible to create a similar form from scratch which you can customize to your project and that is what I could help you with. In the meantime, loose the select statement all together. Though it will be just as successful, what you've done is exactly the same as this: Sub Button15_Click() Worksheets("test").ShowDataForm End Sub To see what I mean, open your VBA Editor, if the Project Viewer is not visible hit Ctrl + R to open it and click on the project you're working on. On the main menu click Insert--User Form and a blank form and a toolbox will appear. This form can be given any entry fields and layout you want and will be much easier to use for what you have in mind. If you're interested in learning about this say so, I won't go into it otherwise. If not, I'm afraid I don't know how to open the form you're talking about... - Pikus --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How can run a macro ( call a macro) on selection of any filtercriteria? | Excel Worksheet Functions | |||
How can I call IE browser (Back button) through Excel macro? | Excel Discussion (Misc queries) | |||
How can I call IE browser (Back button) through Excel macro? | Excel Discussion (Misc queries) | |||
Button fails to call macro when open an Excel via Intranet | Excel Discussion (Misc queries) | |||
button to call website | Excel Programming |