ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Is there a code that anables you tto search for a worksheet (https://www.excelbanter.com/excel-discussion-misc-queries/121329-there-code-anables-you-tto-search-worksheet.html)

AOU

Is there a code that anables you tto search for a worksheet
 
Is there a code that anables you to search for a worksheet by reference to
the Tabs, and if it exsists display the sheet or if it does not exsists
create a new worksheet from a template (say sheet1)?
--
AOU

Don Guillett

Is there a code that anables you tto search for a worksheet
 
Sub makesheetorgoto()
On Error GoTo makeit
Sheets("joe").Select
Exit Sub
makeit:
Sheets.Add.Name = "joe"
End Sub

--
Don Guillett
SalesAid Software

"AOU" wrote in message
...
Is there a code that anables you to search for a worksheet by reference to
the Tabs, and if it exsists display the sheet or if it does not exsists
create a new worksheet from a template (say sheet1)?
--
AOU




AOU

Is there a code that anables you tto search for a worksheet
 
Thanks very much Don, very useful. Can you tell me the code if I wanted to
use a Userform for the following: On a click og a commandbuttton a userform
appears and asks to insert name of person to check. If this person has a
sheet then it goes to it, if there is no sheet a messagebox asks if you want
to create a new sheet for the person. If yes then copies from a template
(sheet1) and open it.
Would very much appreciate help on this.
Thank you
--
AOU


"Don Guillett" wrote:

Sub makesheetorgoto()
On Error GoTo makeit
Sheets("joe").Select
Exit Sub
makeit:
Sheets.Add.Name = "joe"
End Sub

--
Don Guillett
SalesAid Software

"AOU" wrote in message
...
Is there a code that anables you to search for a worksheet by reference to
the Tabs, and if it exsists display the sheet or if it does not exsists
create a new worksheet from a template (say sheet1)?
--
AOU





Don Guillett

Is there a code that anables you tto search for a worksheet
 
Easier than that would be to just add an input box and a sheet copy .

Sub makesheetorgoto()
ms=inputbox("Name desired")

Sub makesheetorgoto()
ms = InputBox("Enter Name")
On Error GoTo makeit
Sheets(ms).Select
Exit Sub
makeit:
Sheets("sheet1").Copy after:=ActiveSheet
ActiveSheet.Name = ms
End Sub

--
Don Guillett
SalesAid Software

"AOU" wrote in message
...
Thanks very much Don, very useful. Can you tell me the code if I wanted to
use a Userform for the following: On a click og a commandbuttton a
userform
appears and asks to insert name of person to check. If this person has a
sheet then it goes to it, if there is no sheet a messagebox asks if you
want
to create a new sheet for the person. If yes then copies from a template
(sheet1) and open it.
Would very much appreciate help on this.
Thank you
--
AOU


"Don Guillett" wrote:

Sub makesheetorgoto()
On Error GoTo makeit
Sheets("joe").Select
Exit Sub
makeit:
Sheets.Add.Name = "joe"
End Sub

--
Don Guillett
SalesAid Software

"AOU" wrote in message
...
Is there a code that anables you to search for a worksheet by reference
to
the Tabs, and if it exsists display the sheet or if it does not exsists
create a new worksheet from a template (say sheet1)?
--
AOU








All times are GMT +1. The time now is 11:35 AM.

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