Button to Create New Sheet

Whatisanexcel

New Member
Joined
Jan 20, 2022
Messages
3
Office Version
  1. 2021
Platform
  1. Windows
Hello Everyone!

Happy New Year!

I am making a model and would like to create a landing page where I would type numbers and click on a button. When I click on this button it creates a copy of another sheet and makes the adjustment stated on the landing page.

Is this possible, if so how can I accomplish this?

Any advice helps!

Thank you in advance.
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
paste the code into a module ,
set your source items on the LANDING sheet. (here mine are Source Sheet to copy (B2), & values to save B3-B5
then run: CopyLanding

Code:
Sub CopyLanding()
Dim wsSrc As Worksheet, wsTarg As Worksheet, wsLand As Worksheet
Dim vVal1, vVal2, vVal3
Set wsLand = Sheets("Landing")
wsLand.Activate

  'what sheet to copy from in B2
Set wsSrc = Sheets(Range("b2").Value)

 'grab the entered values
vVal1 = Range("b3").Value
vVal2 = Range("b4").Value
vVal3 = Range("b5").Value

 'copy src sheet in B2
wsSrc.Select
wsSrc.Copy After:=Sheets(Sheets.Count)
Set wsTarg = ActiveSheet
'wsTarg.Name = "something"  'rename new sheet

  'post new values
Range("d3").Value = vVal1
Range("d4").Value = vVal2
Range("d5").Value = vVal3
End Sub
 
Upvote 0
paste the code into a module ,
set your source items on the LANDING sheet. (here mine are Source Sheet to copy (B2), & values to save B3-B5
then run: CopyLanding

Code:
Sub CopyLanding()
Dim wsSrc As Worksheet, wsTarg As Worksheet, wsLand As Worksheet
Dim vVal1, vVal2, vVal3
Set wsLand = Sheets("Landing")
wsLand.Activate

  'what sheet to copy from in B2
Set wsSrc = Sheets(Range("b2").Value)

 'grab the entered values
vVal1 = Range("b3").Value
vVal2 = Range("b4").Value
vVal3 = Range("b5").Value

 'copy src sheet in B2
wsSrc.Select
wsSrc.Copy After:=Sheets(Sheets.Count)
Set wsTarg = ActiveSheet
'wsTarg.Name = "something"  'rename new sheet

  'post new values
Range("d3").Value = vVal1
Range("d4").Value = vVal2
Range("d5").Value = vVal3
End Sub
Thank you so much!! Will try this right away, thank you!!
 
Upvote 0
paste the code into a module ,
set your source items on the LANDING sheet. (here mine are Source Sheet to copy (B2), & values to save B3-B5
then run: CopyLanding

Code:
Sub CopyLanding()
Dim wsSrc As Worksheet, wsTarg As Worksheet, wsLand As Worksheet
Dim vVal1, vVal2, vVal3
Set wsLand = Sheets("Landing")
wsLand.Activate

  'what sheet to copy from in B2
Set wsSrc = Sheets(Range("b2").Value)

 'grab the entered values
vVal1 = Range("b3").Value
vVal2 = Range("b4").Value
vVal3 = Range("b5").Value

 'copy src sheet in B2
wsSrc.Select
wsSrc.Copy After:=Sheets(Sheets.Count)
Set wsTarg = ActiveSheet
'wsTarg.Name = "something"  'rename new sheet

  'post new values
Range("d3").Value = vVal1
Range("d4").Value = vVal2
Range("d5").Value = vVal3
End Sub
It worked exactly how I wanted it to!! You are amazing, thank you soo much!!
 
Upvote 0

Forum statistics

Threads
1,223,898
Messages
6,175,272
Members
452,628
Latest member
dd2

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