ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Curiosity (https://www.excelbanter.com/excel-discussion-misc-queries/150519-curiosity.html)

Excluxe

Curiosity
 
So just a thought. I am making an estimating program/spreasheet. Now there
can be one or more phases to a project and I was wondering is there anyway so
that when this workbook is opened to be asked for the amount of phases and
then automatically create that many copies of the master sheet and then add
their to totals to a totals sheet. Or is this far to crazy to be done
without years of computer programming.

Chip Pearson

Curiosity
 
Something like the following may do what you want:

Sub Auto_Open()
Dim N As Long
Dim M As Long
N = Application.InputBox(prompt:="Number Of Phases", Type:=1)
If N 0 Then
With ThisWorkbook.Worksheets
For M = 1 To N
.Item("Master").Copy after:=.Item(.Count)
.Item(.Count).Name = "Phase " & CStr(M)
Next M
End With
End If
End Sub


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

"Excluxe" wrote in message
...
So just a thought. I am making an estimating program/spreasheet. Now
there
can be one or more phases to a project and I was wondering is there anyway
so
that when this workbook is opened to be asked for the amount of phases and
then automatically create that many copies of the master sheet and then
add
their to totals to a totals sheet. Or is this far to crazy to be done
without years of computer programming.



Excluxe

Curiosity
 
So i think it might want to work something poped about macros and security
aslo i am new to this code part of excell so i really don't have a clue want
exactly to do with this formula. I entered it in the code part of excell
hence getting the thing about macros. The sheet I need to duplicate is HVAC
PRICING. I am assuming I need to place this in the formula but quite no
where.
Appreciate any help you can give me thanks.

P.S. Oh yeah and technical jargon just dumbed down a little is fine. I
have played with this stuff but not since I was 9-10 so I remember little if
anything. Thanks

"Chip Pearson" wrote:

Something like the following may do what you want:

Sub Auto_Open()
Dim N As Long
Dim M As Long
N = Application.InputBox(prompt:="Number Of Phases", Type:=1)
If N 0 Then
With ThisWorkbook.Worksheets
For M = 1 To N
.Item("Master").Copy after:=.Item(.Count)
.Item(.Count).Name = "Phase " & CStr(M)
Next M
End With
End If
End Sub


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

"Excluxe" wrote in message
...
So just a thought. I am making an estimating program/spreasheet. Now
there
can be one or more phases to a project and I was wondering is there anyway
so
that when this workbook is opened to be asked for the amount of phases and
then automatically create that many copies of the master sheet and then
add
their to totals to a totals sheet. Or is this far to crazy to be done
without years of computer programming.




All times are GMT +1. The time now is 09:10 PM.

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