Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
delete userforms in vba
Hey everyone,
I'm trying to get rid of a form I created in a project so I can import another one which has the same name. But so far I havent been able to find a way to do it. So please let me know if thats possible and if not what would be the solution to my problem. Thx |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
delete userforms in vba
In the code window, right-click on the user-form name in the left column and
select "Remove Userform". -- Best wishes, Jim "malpropio" wrote: Hey everyone, I'm trying to get rid of a form I created in a project so I can import another one which has the same name. But so far I havent been able to find a way to do it. So please let me know if thats possible and if not what would be the solution to my problem. Thx |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
delete userforms in vba
in the project explorer in the VBE, right click on you userform entry under
the appropriate workbook and select remove. -- Regards, Tom Ogilvy "malpropio" wrote: Hey everyone, I'm trying to get rid of a form I created in a project so I can import another one which has the same name. But so far I havent been able to find a way to do it. So please let me know if thats possible and if not what would be the solution to my problem. Thx |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
delete userforms in vba
Thk u Tom and Jim,
But I don't know if its because I'm using the vb code editor of excel but when I right click on the userform in the project explorer it does not give me the choice to delete it. malpropio |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
delete userforms in vba
You must right click on the form you want to remove, not just in the project
window. "malpropio" wrote: Thk u Tom and Jim, But I don't know if its because I'm using the vb code editor of excel but when I right click on the userform in the project explorer it does not give me the choice to delete it. malpropio |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
delete userforms in vba
If you want to do this by code, set a reference to the VBA 5.3 Extensibility
Library (in VBA, go to the Tools menu, choose References, and check "Microsoft Visual Basic For Applications Extensibility Library 5.3"). Then use code like Sub DeleteForm() Dim VBComps As VBIDE.VBComponents Dim VBComp As VBIDE.VBComponent Set VBComps = Workbooks("Book1.xls").VBProject.VBComponents Set VBComp = VBComps("UserForm1") VBComps.Remove VBComp End Sub See www.cpearson.com/excel/vbe.htm for more details and example code. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com (email address is on the web site) "malpropio" wrote in message oups.com... Hey everyone, I'm trying to get rid of a form I created in a project so I can import another one which has the same name. But so far I havent been able to find a way to do it. So please let me know if thats possible and if not what would be the solution to my problem. Thx |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
delete userforms in vba
Or, simpler, without needing a library reference:
Sub DeleteForm() With Workbooks("Book1.xls").VBProject.VBComponents .Remove .Item("UserForm1") End With End Sub -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com (email address is on the web site) "Chip Pearson" wrote in message ... If you want to do this by code, set a reference to the VBA 5.3 Extensibility Library (in VBA, go to the Tools menu, choose References, and check "Microsoft Visual Basic For Applications Extensibility Library 5.3"). Then use code like Sub DeleteForm() Dim VBComps As VBIDE.VBComponents Dim VBComp As VBIDE.VBComponent Set VBComps = Workbooks("Book1.xls").VBProject.VBComponents Set VBComp = VBComps("UserForm1") VBComps.Remove VBComp End Sub See www.cpearson.com/excel/vbe.htm for more details and example code. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com (email address is on the web site) "malpropio" wrote in message oups.com... Hey everyone, I'm trying to get rid of a form I created in a project so I can import another one which has the same name. But so far I havent been able to find a way to do it. So please let me know if thats possible and if not what would be the solution to my problem. Thx |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
delete userforms in vba
I didn't say to right click on the userform itself. Re read my post.
All actions are performed in the project explorer window (defaults to the upper left of the VBE). You right click on the name of the Useform as shown in the project explorer. -- Regards, Tom Ogilvy "malpropio" wrote in message oups.com... Thk u Tom and Jim, But I don't know if its because I'm using the vb code editor of excel but when I right click on the userform in the project explorer it does not give me the choice to delete it. malpropio |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
I need some help with userforms | Charts and Charting in Excel | |||
I need some help with userforms | Excel Discussion (Misc queries) | |||
Two Userforms | Excel Programming | |||
Delete every 3rd row, then delete rows 2-7, move info f/every 2nd row up one to the end and delete the row below | Excel Programming | |||
Delete Modules and Userforms | Excel Programming |