Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 196
Default Searching for worksheet

I am using Excel 97.

Can anyone assist me please?

I am wanting some code which with the use of an input box
searches all the worksheets in a workbook for a sheet
with that value.

A user can enter either a name of a numerical value and
the worksheets are checked, if no worksheet is found then
a new sheet is created with the name of the value of the
input box.

I have something similar in place at the moment but it
doesn't always work correctly as some of the worksheets
have similar names!

Any offers?

Thanks


Mark
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Searching for worksheet

mark copy the code into this post so that we can have a look it may just
be simple case of change part of the code,

Save all of us a bit of time


---
Message posted from http://www.ExcelForum.com/

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default Searching for worksheet

blnExists = False
For a = 1 To Sheets.Count
If Sheets(a).Name = strInputName Then blnExists = True
Next
If blnExists = False Then
Sheets.Add
Sheets(Sheets.Count).Name = strInputName
Else
Sheets(strInputName).Select
End If

Cheers,

Jeff

"Mark" wrote in message
...
I am using Excel 97.

Can anyone assist me please?

I am wanting some code which with the use of an input box
searches all the worksheets in a workbook for a sheet
with that value.

A user can enter either a name of a numerical value and
the worksheets are checked, if no worksheet is found then
a new sheet is created with the name of the value of the
input box.

I have something similar in place at the moment but it
doesn't always work correctly as some of the worksheets
have similar names!

Any offers?

Thanks


Mark



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default Searching for worksheet

Not sure if it's clear or not that strInputName is what your InputBox
returns.

Jeff

"Jeff Standen" wrote in message
...
blnExists = False
For a = 1 To Sheets.Count
If Sheets(a).Name = strInputName Then blnExists = True
Next
If blnExists = False Then
Sheets.Add
Sheets(Sheets.Count).Name = strInputName
Else
Sheets(strInputName).Select
End If

Cheers,

Jeff

"Mark" wrote in message
...
I am using Excel 97.

Can anyone assist me please?

I am wanting some code which with the use of an input box
searches all the worksheets in a workbook for a sheet
with that value.

A user can enter either a name of a numerical value and
the worksheets are checked, if no worksheet is found then
a new sheet is created with the name of the value of the
input box.

I have something similar in place at the moment but it
doesn't always work correctly as some of the worksheets
have similar names!

Any offers?

Thanks


Mark





  #5   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Searching for worksheet

Here's my code:

Sub GoToBadge()

NameNumber = InputBox(prompt:="Enter Name or Number")
On Error GoTo NewName
' this on error causes a fail to find to go to create a
new record
Worksheets(NameNumber).Activate
' this find goes to first empty cell in leave record
FindEmptyCell
Exit Sub

NewName:
On Error GoTo FINISH
If DialogSheets("GetNumDialog").Show Then
EmpType
Newsheet = ActiveSheet.Name
Worksheets(Newsheet).Name = NameNumber
Cells(4, "C").Value = NameNumber
OfficerName = InputBox(prompt:="Enter Name")
Cells(4, 1).Value = FullName
StartDate = InputBox(prompt:="Enter Date Joining,
DD/MM/YYYY")
Cells(2, 2).Value = CDate(StartDate)
Resume
Else
End If
FINISH:
End Sub


-----Original Message-----
I am using Excel 97.

Can anyone assist me please?

I am wanting some code which with the use of an input

box
searches all the worksheets in a workbook for a sheet
with that value.

A user can enter either a name of a numerical value and
the worksheets are checked, if no worksheet is found

then
a new sheet is created with the name of the value of the
input box.

I have something similar in place at the moment but it
doesn't always work correctly as some of the worksheets
have similar names!

Any offers?

Thanks


Mark
.



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
Searching worksheet and exporting name to other sheet OshawaChris Excel Discussion (Misc queries) 1 December 20th 08 04:47 PM
Searching for data and placing in new worksheet Davey T Excel Worksheet Functions 0 August 26th 07 06:12 PM
Searching numbers in Worksheet Johncobb45 Excel Worksheet Functions 6 August 5th 06 08:00 PM
Searching numbers in Worksheet? Johncobb45 Excel Worksheet Functions 2 July 31st 06 10:02 AM
Searching numbers in Worksheet? Johncobb45 Excel Worksheet Functions 3 July 28th 06 07:07 PM


All times are GMT +1. The time now is 02:20 AM.

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

About Us

"It's about Microsoft Excel"