PC Review


Reply
Thread Tools Rate Thread

Create worksheets and populate

 
 
Alberto Pinto
Guest
Posts: n/a
 
      25th Oct 2006
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


 
Reply With Quote
 
 
 
 
Chip Pearson
Guest
Posts: n/a
 
      25th Oct 2006
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>



 
Reply With Quote
 
Alberto Pinto
Guest
Posts: n/a
 
      25th Oct 2006
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" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> 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
>>

>
>



 
Reply With Quote
 
NickHK
Guest
Posts: n/a
 
      25th Oct 2006
Alberto,
Record a macro of your actions, Tools>Macro>Record New Macro..

Check the Help and Object Browser.

NickHK

"Alberto Pinto" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
> > 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" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> >> 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
> >>

> >
> >

>
>



 
Reply With Quote
 
Alberto Pinto
Guest
Posts: n/a
 
      30th Oct 2006
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Alberto,
> Record a macro of your actions, Tools>Macro>Record New Macro..
>
> Check the Help and Object Browser.
>
> NickHK
>
> "Alberto Pinto" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> 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" <(E-Mail Removed)> wrote in message
>> news:%(E-Mail Removed)...
>> > 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" <(E-Mail Removed)> wrote in message
>> > news:(E-Mail Removed)...
>> >> 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
>> >>
>> >
>> >

>>
>>

>
>



 
Reply With Quote
 
NickHK
Guest
Posts: n/a
 
      31st Oct 2006
In the VBE, got to Help and type "Object Model"

NickHK

"Alberto Pinto" <(E-Mail Removed)> wrote in message
news:OK$C3zE$(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Alberto,
> > Record a macro of your actions, Tools>Macro>Record New Macro..
> >
> > Check the Help and Object Browser.
> >
> > NickHK
> >
> > "Alberto Pinto" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> >> 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" <(E-Mail Removed)> wrote in message
> >> news:%(E-Mail Removed)...
> >> > 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" <(E-Mail Removed)> wrote in message
> >> > news:(E-Mail Removed)...
> >> >> 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
> >> >>
> >> >
> >> >
> >>
> >>

> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to populate many worksheets in a workbook chrisk Microsoft Excel Misc 4 29th Aug 2008 01:37 PM
How use info in Excel shared worksheets to create new worksheets =?Utf-8?B?ZGtj?= Microsoft Excel Worksheet Functions 0 28th Jun 2007 08:36 PM
Populate multiple worksheets =?Utf-8?B?Vmlja2k=?= Microsoft Excel Programming 3 2nd Nov 2006 07:30 PM
how to auto populate full worksheets =?Utf-8?B?aG95dA==?= Microsoft Excel New Users 0 13th Jun 2006 08:39 AM
How to automatically create and populate worksheets? anthonyberet Microsoft Excel Programming 4 25th May 2006 12:06 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:39 AM.