VB Duplicate & Rename Sheets

Rioulol

New Member
Joined
Aug 1, 2022
Messages
1
Office Version
  1. 365
  2. 2021
  3. 2019
  4. 2016
Platform
  1. Windows
Hi there,

RE: VB Duplicate & Rename Sheets

I'm relatively new to VB, so you'll have to excuse my ignorance when it comes to some of the technicality behind it.

I'm looking to have a form with a Textbox on it, and when you press the submit button it will perform the following functions:

1. Check if the value of Textbox, on the form, exists anywhere in a table named 'tblCompanies' in a named ranged called 'rngCompanies' on a sheet named 'Company Data', if there is, show label (lblError) and stop the code, if not, then add a new record to the table which is the value of the Textbox on the form.
1. Duplicate a form named "Company" and rename the new sheet to whatever is in the Textbox field on the form.
2. Duplicate a form named "Company Settings" and rename the new sheet to what is in the Textbox field on the form + ' settings'.

If anyone could help me with this query, it is massively appreciated.

Thanks in advance.
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
When you say:
I'm looking to have a form with a Textbox on it

Do you mean a: "UserForm"

If not, what is a "Form"?

And you said:
Duplicate a form named "Company Settings

What is a form???
 
Upvote 0

Forum statistics

Threads
1,214,877
Messages
6,122,051
Members
449,064
Latest member
scottdog129

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