Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using a macro to open an existing workbook
I have a jobs list in a work book named Jobs & Jobs Sheets in a folder called
Job Sheets. I want to select a job in Jobs & run a macro that opens the job sheet that has the name in the activecell. If the job sheet does not exist then I want a job sheet created from a template in the the job sheet folder. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using a macro to open an existing workbook
Dim sh As Worksheet
Dim mpName As String On Error Resume Next Set sh = Worksheets(ActiveCell.Value) On Error GoTo 0 If sh Is Nothing Then mpName = ActiveCell.Value Set sh = Worksheets.Add sh.Name = mpName End If sh.Activate -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "chrism" wrote in message ... I have a jobs list in a work book named Jobs & Jobs Sheets in a folder called Job Sheets. I want to select a job in Jobs & run a macro that opens the job sheet that has the name in the activecell. If the job sheet does not exist then I want a job sheet created from a template in the the job sheet folder. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using a macro to open an existing workbook
Thanks Bob, That works but I should have said the jobsheet is actually a
workbook so I will fiddle with your code to make it open or create a workbook. I'll let you know how I go Chris marwick NZ "Bob Phillips" wrote: Dim sh As Worksheet Dim mpName As String On Error Resume Next Set sh = Worksheets(ActiveCell.Value) On Error GoTo 0 If sh Is Nothing Then mpName = ActiveCell.Value Set sh = Worksheets.Add sh.Name = mpName End If sh.Activate -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "chrism" wrote in message ... I have a jobs list in a work book named Jobs & Jobs Sheets in a folder called Job Sheets. I want to select a job in Jobs & run a macro that opens the job sheet that has the name in the activecell. If the job sheet does not exist then I want a job sheet created from a template in the the job sheet folder. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
export data to an existing and open workbook without knowing the f | Excel Programming | |||
Open workbook in existing Excel session | Excel Programming | |||
Blank workbook opens when try to open any existing book | Excel Discussion (Misc queries) | |||
Open an existing workbook and reference it | Excel Programming | |||
Open existing workbook | Excel Programming |