How to Make Copy(ies) of Worksheet?

K_Man95

Board Regular
Joined
Jul 31, 2002
Messages
158
I have a Master UserForm with 3 command buttons - Next , Review , Create. I also have several textboxes and comboboxes on this UserForm. One of the ComboBoxes is populated with Numbering from 1 - 65534. Here is my two part question: (I hope I explain this well enough and yes, it all needs to work together) 1) How can I save a copy of the values entered in the textboxes based on the Number? (i.e. Form #1 has information a,b,c from textboxes 1,2,3 and Form #x has information x,y,z from textboxes 1,2,3). 2) How can I create a new workbook for each Form Number? (i.e. Form 1 gets Workbook 1, Form 2 gets Workbook 2, Form 3 gets Workbook 3...... Form 5000 gets Workbook 5000)

I have not started any code as of yet cause I am not really sure where to begin. I am fairly new to VBA. If I can offer any more information, please do not hesitate to contact me. Thanks in advance for all the help. Sorry for making this a two part, but it seems to be all related. Hope everyone understands.
This message was edited by K_Man95 on 2002-09-09 13:52
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Hi
About Q1:
1) How can I save a copy of the values entered in the textboxes based on the Number?
I know 3 way to save, you are using Excel so I think the first one is better.
1.put the value on cells
2.save the value as text file
3.save the value on registry

About Q2:
2) How can I create a new workbook for each Form Number?
You can add workbooks for the using "Workbooks.add" code.
The value of comboboxes can be got like .. Userform1.ComboBox1.value .
 
Upvote 0
This is just a basic example of how to capture data from a text box based on the value in a combo box.

These controls were placed on an Excel sheet rather than a form but it might get you started.

Sub GetData()

Dim lngValue as long
Dim strText as String

lngValue = 1

If ThisWorkbook.Worksheets("Sheet1").ComboBox1.Text = lngValue Then

strText = ThisWorkbook.Worksheets("Sheet1").TextBox1.Text

End If

End Sub
 
Upvote 0

Forum statistics

Threads
1,213,538
Messages
6,114,218
Members
448,554
Latest member
Gleisner2

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
Back
Top