ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How to create a new page with a button? (https://www.excelbanter.com/excel-discussion-misc-queries/199677-how-create-new-page-button.html)

Ruben

How to create a new page with a button?
 
I would like to create a button by a visual basic code.
On my first sheet I have a button. If I click on this button a new page is
created. On this new page I would like to create a button with a macro code,
but I don't know how. So the button on sheet 2 has to be created by a macro
code behind the button on page 1. In summary, the macro behind the button on
sheet 1 has to include the creation of a new page with a button. Thanks for
helping!

Don Guillett

How to create a new page with a button?
 
I just recorded this.

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 8/21/2008 by Donald B. Guillett
'

'
Sheets.Add
ActiveSheet.Shapes.AddShape(msoShapeRectangle, 249#, 22.5, 47.25,
35.25). _
Select
Selection.OnAction = "Rectangle1_Click"
'OR
'Selection.OnAction = "Macro1"
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Ruben" wrote in message
...
I would like to create a button by a visual basic code.
On my first sheet I have a button. If I click on this button a new page is
created. On this new page I would like to create a button with a macro
code,
but I don't know how. So the button on sheet 2 has to be created by a
macro
code behind the button on page 1. In summary, the macro behind the button
on
sheet 1 has to include the creation of a new page with a button. Thanks
for
helping!



Ruben

How to create a new page with a button?
 
Thanks!!

"Don Guillett" wrote:

I just recorded this.

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 8/21/2008 by Donald B. Guillett
'

'
Sheets.Add
ActiveSheet.Shapes.AddShape(msoShapeRectangle, 249#, 22.5, 47.25,
35.25). _
Select
Selection.OnAction = "Rectangle1_Click"
'OR
'Selection.OnAction = "Macro1"
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Ruben" wrote in message
...
I would like to create a button by a visual basic code.
On my first sheet I have a button. If I click on this button a new page is
created. On this new page I would like to create a button with a macro
code,
but I don't know how. So the button on sheet 2 has to be created by a
macro
code behind the button on page 1. In summary, the macro behind the button
on
sheet 1 has to include the creation of a new page with a button. Thanks
for
helping!




Don Guillett

How to create a new page with a button?
 

Glad to help
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Ruben" wrote in message
...
Thanks!!

"Don Guillett" wrote:

I just recorded this.

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 8/21/2008 by Donald B. Guillett
'

'
Sheets.Add
ActiveSheet.Shapes.AddShape(msoShapeRectangle, 249#, 22.5, 47.25,
35.25). _
Select
Selection.OnAction = "Rectangle1_Click"
'OR
'Selection.OnAction = "Macro1"
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Ruben" wrote in message
...
I would like to create a button by a visual basic code.
On my first sheet I have a button. If I click on this button a new page
is
created. On this new page I would like to create a button with a macro
code,
but I don't know how. So the button on sheet 2 has to be created by a
macro
code behind the button on page 1. In summary, the macro behind the
button
on
sheet 1 has to include the creation of a new page with a button. Thanks
for
helping!






All times are GMT +1. The time now is 12:44 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com