Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Pal Pal is offline
external usenet poster
 
Posts: 27
Default duplicate a user form?

Is it possible to duplicate a user form?
I have one that I want to use twice with only a slight modification.
I did not see an option to copy paste from the project section.

Thanks
Pal


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default duplicate a user form?

File Export the form, rename the project one, or the file, and re-import it.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Pal" wrote in message
news:DWUjc.8038$RE1.813063@attbi_s54...
Is it possible to duplicate a user form?
I have one that I want to use twice with only a slight modification.
I did not see an option to copy paste from the project section.

Thanks
Pal




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default duplicate a user form?

"Pal" skrev i melding
news:DWUjc.8038$RE1.813063@attbi_s54...
Is it possible to duplicate a user form?
I have one that I want to use twice with only a slight modification.


Hi Pal

Welcome tho the world of classes and objects. Plan a form flexible enough
and you can use it for infinite variations.

In an empty workbook, create one single Userform1 with CommandButton1 and
CommandButton2. Then in a standard module paste and run this:

Sub ThreeForms()
Dim U1 As UserForm1
Dim U2 As UserForm1
Dim U3 As UserForm1

Set U1 = New UserForm1
U1.BackColor = RGB(0, 0, 255)
U1.CommandButton1.Caption = "Yo da man !"
U1.CommandButton1.Top = U1.Height / 2 - _
U1.CommandButton1.Height / 2
U1.CommandButton1.Left = U1.Width / 2 - _
U1.CommandButton1.Width / 2
U1.CommandButton2.Visible = False
U1.Caption = "Yo da man ?"

Set U2 = New UserForm1
U2.BackColor = RGB(210, 255, 175)
U2.CommandButton1.Caption = "Absolutely"
U2.CommandButton2.Caption = "Neat !"
U2.Caption = "Beauty contest"

Set U3 = New UserForm1
U3.BackColor = RGB(255, 255, 0)
U3.CommandButton1.Caption = "Abort"
U3.CommandButton1.BackColor = RGB(255, 0, 0)
U3.CommandButton1.Top = 3
U3.CommandButton1.Left = 6
U3.CommandButton2.Top = 25
U3.CommandButton2.Left = 6
U3.CommandButton2.Caption = "Cancel"
U3.CommandButton2.BackColor = RGB(255, 0, 0)
U3.Caption = "Install Windows XP"

U1.Show
U2.Show
U3.Show

End Sub

HTH. Best wishes Harald


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 340
Default duplicate a user form?

Copy the form to another workbook, rename the copy, then copy it back.

Bob Flanagan
Macro Systems
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel

"Pal" wrote in message
news:DWUjc.8038$RE1.813063@attbi_s54...
Is it possible to duplicate a user form?
I have one that I want to use twice with only a slight modification.
I did not see an option to copy paste from the project section.

Thanks
Pal




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I fill a cell in a user form from a selection on same form? Terry Tipsy Excel Discussion (Misc queries) 4 June 11th 07 02:59 PM
User form Mike Rogers Excel Discussion (Misc queries) 2 March 10th 06 05:56 PM
User Form Still Trying mully New Users to Excel 3 May 26th 05 06:30 PM
User Form Rockee052[_4_] Excel Programming 4 December 30th 03 08:14 AM
I am looking to see if anybody has an equivalant user form to Outlooks CONTACT form BruceJ[_2_] Excel Programming 2 October 15th 03 05:28 PM


All times are GMT +1. The time now is 09:18 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"