ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Create worksheets and populate (https://www.excelbanter.com/excel-programming/375891-create-worksheets-populate.html)

Alberto Pinto

Create worksheets and populate
 
How can I programatically (vb or macro) create new worksheets (ideally based
on a template) on my workbook and populate that new worksheets from a list
of data?

Thanks in advance



Chip Pearson

Create worksheets and populate
 
Alberto,

Try some code like the following:

With ActiveWorkbook.Worksheets
Workbooks("Templ.xls").Worksheets("Template").Copy after:=.Item(.Count)
.Item(.Count).Select
End With

This will copy the worksheet named "Template" from the workbook "Templ.xls"
to the ActiveWorkbook.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
www.cpearson.com
(email address is on the web site)


"Alberto Pinto" wrote in message
...
How can I programatically (vb or macro) create new worksheets (ideally
based on a template) on my workbook and populate that new worksheets from
a list of data?

Thanks in advance




Alberto Pinto

Create worksheets and populate
 
Great! Thanks.

Do you know how can i rename and move the new worksheet?
where can i get the list of macros methods and properties available on Excel
?


"Chip Pearson" wrote in message
...
Alberto,

Try some code like the following:

With ActiveWorkbook.Worksheets
Workbooks("Templ.xls").Worksheets("Template").Copy after:=.Item(.Count)
.Item(.Count).Select
End With

This will copy the worksheet named "Template" from the workbook
"Templ.xls" to the ActiveWorkbook.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
www.cpearson.com
(email address is on the web site)


"Alberto Pinto" wrote in message
...
How can I programatically (vb or macro) create new worksheets (ideally
based on a template) on my workbook and populate that new worksheets from
a list of data?

Thanks in advance






NickHK

Create worksheets and populate
 
Alberto,
Record a macro of your actions, ToolsMacroRecord New Macro..

Check the Help and Object Browser.

NickHK

"Alberto Pinto" wrote in message
...
Great! Thanks.

Do you know how can i rename and move the new worksheet?
where can i get the list of macros methods and properties available on

Excel
?


"Chip Pearson" wrote in message
...
Alberto,

Try some code like the following:

With ActiveWorkbook.Worksheets
Workbooks("Templ.xls").Worksheets("Template").Copy

after:=.Item(.Count)
.Item(.Count).Select
End With

This will copy the worksheet named "Template" from the workbook
"Templ.xls" to the ActiveWorkbook.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
www.cpearson.com
(email address is on the web site)


"Alberto Pinto" wrote in message
...
How can I programatically (vb or macro) create new worksheets (ideally
based on a template) on my workbook and populate that new worksheets

from
a list of data?

Thanks in advance








Alberto Pinto

Create worksheets and populate
 
This can be a very simple question but I can't find information about the
Worksheet(neither about the workbook or others) object in VB for Office Help
or Excel Help.
Where can I find this info?

"NickHK" wrote in message
...
Alberto,
Record a macro of your actions, ToolsMacroRecord New Macro..

Check the Help and Object Browser.

NickHK

"Alberto Pinto" wrote in message
...
Great! Thanks.

Do you know how can i rename and move the new worksheet?
where can i get the list of macros methods and properties available on

Excel
?


"Chip Pearson" wrote in message
...
Alberto,

Try some code like the following:

With ActiveWorkbook.Worksheets
Workbooks("Templ.xls").Worksheets("Template").Copy

after:=.Item(.Count)
.Item(.Count).Select
End With

This will copy the worksheet named "Template" from the workbook
"Templ.xls" to the ActiveWorkbook.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
www.cpearson.com
(email address is on the web site)


"Alberto Pinto" wrote in message
...
How can I programatically (vb or macro) create new worksheets (ideally
based on a template) on my workbook and populate that new worksheets

from
a list of data?

Thanks in advance










NickHK

Create worksheets and populate
 
In the VBE, got to Help and type "Object Model"

NickHK

"Alberto Pinto" wrote in message
...
This can be a very simple question but I can't find information about the
Worksheet(neither about the workbook or others) object in VB for Office

Help
or Excel Help.
Where can I find this info?

"NickHK" wrote in message
...
Alberto,
Record a macro of your actions, ToolsMacroRecord New Macro..

Check the Help and Object Browser.

NickHK

"Alberto Pinto" wrote in message
...
Great! Thanks.

Do you know how can i rename and move the new worksheet?
where can i get the list of macros methods and properties available on

Excel
?


"Chip Pearson" wrote in message
...
Alberto,

Try some code like the following:

With ActiveWorkbook.Worksheets
Workbooks("Templ.xls").Worksheets("Template").Copy

after:=.Item(.Count)
.Item(.Count).Select
End With

This will copy the worksheet named "Template" from the workbook
"Templ.xls" to the ActiveWorkbook.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
www.cpearson.com
(email address is on the web site)


"Alberto Pinto" wrote in message
...
How can I programatically (vb or macro) create new worksheets

(ideally
based on a template) on my workbook and populate that new worksheets

from
a list of data?

Thanks in advance













All times are GMT +1. The time now is 04:26 PM.

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