Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
MrT
 
Posts: n/a
Default new sheet created 'on the fly' from template in same workbook - H.

looking for an excel solution to create a new sheet at the end based on the
contents of a template sheet within the same workbook.
  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default

One way:

Worksheets("template").Copy _
after:=Worksheets(Worksheets.Count)





MrT wrote:

looking for an excel solution to create a new sheet at the end based on the
contents of a template sheet within the same workbook.


--

Dave Peterson
  #3   Report Post  
MrT
 
Posts: n/a
Default

Thankyou Dave

Could you help with another question?

I am very new to excel and am trying to build a tool to help me define tasks
in my work day schedule.

Now I can create a new sheet 'on the fly' How would I copy the contents of a
cell in an existing sheet to a cell on the new sheet; and How would i rename
the new sheet based on cell contents?

MrT

"Dave Peterson" wrote:

One way:

Worksheets("template").Copy _
after:=Worksheets(Worksheets.Count)





MrT wrote:

looking for an excel solution to create a new sheet at the end based on the
contents of a template sheet within the same workbook.


--

Dave Peterson

  #4   Report Post  
Dave Peterson
 
Posts: n/a
Default

It's probably best to just start a new thread for different questions. And I
think it's better to address any question to the whole world--not just one
person. You'll usually get a quicker response than waiting for any particular
person.

But this worked ok for me:

Option Explicit
Sub testme()

Dim newWks As Worksheet
Dim TemplateWks As Worksheet
Dim OtherWks As Worksheet

Set TemplateWks = Worksheets("template")
Set OtherWks = Worksheets("othersheet")

TemplateWks.Copy _
after:=Worksheets(Worksheets.Count)

'the new sheet is now the activesheet
Set newWks = ActiveSheet

With newWks
OtherWks.Range("a1").Copy _
Destination:=.Range("a1")
On Error Resume Next
.Name = .Range("a1").Value
If Err.Number < 0 Then
'rename didn't work
MsgBox "Please rename: " & .Name & " manually"
Err.Clear
End If
On Error GoTo 0
End With

End Sub

(I copied and pasted from A1 to A1--but you can change either/both address.)


MrT wrote:

Thankyou Dave

Could you help with another question?

I am very new to excel and am trying to build a tool to help me define tasks
in my work day schedule.

Now I can create a new sheet 'on the fly' How would I copy the contents of a
cell in an existing sheet to a cell on the new sheet; and How would i rename
the new sheet based on cell contents?

MrT

"Dave Peterson" wrote:

One way:

Worksheets("template").Copy _
after:=Worksheets(Worksheets.Count)





MrT wrote:

looking for an excel solution to create a new sheet at the end based on the
contents of a template sheet within the same workbook.


--

Dave Peterson


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a time sheet template that calculates hours? CTG Excel Discussion (Misc queries) 2 February 24th 05 08:49 PM
How do I print pages 2 & 3 with the Price Sheet template? Joyce Di Excel Worksheet Functions 1 January 7th 05 12:09 AM
How do I use a template after I've created it? j-nette Excel Worksheet Functions 1 December 8th 04 04:40 PM
Function to automatically insert a new sheet as a result of data entry? Mark Mulik Excel Worksheet Functions 2 November 28th 04 02:21 AM
Naming & renaming a sheet tab Cgbilliar Excel Worksheet Functions 1 November 7th 04 05:57 PM


All times are GMT +1. The time now is 01:45 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"