Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 430
Default help with debug

Why is this not working?

Sub FindSheet()
Dim Temp As String
Dim i As Integer
Temp = InputBox("Enter Sheet Name")
For Each Sheet In ActiveWorkbook <<< Bombing here at this line !!
If ActiveSheet.Name = Temp Then
MsgBox "Found the sheet!", vbOKOnly
End If
Next
End Sub

Thanks in Advance,


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default help with debug

Sub FindSheet()
Dim Temp As String
Dim i As Integer
Temp = InputBox("Enter Sheet Name")
For Each Sht In ActiveWorkbook.Worksheets
If lcase(Sht.Name) = lcase(Temp) Then
MsgBox "Found the sheet!", vbOKOnly
Exit For
End If
Next
End Sub

--
Regards,
Tom Ogilvy



"Jim May" wrote in message
news:CI2Sc.17532$Bb.17221@lakeread08...
Why is this not working?

Sub FindSheet()
Dim Temp As String
Dim i As Integer
Temp = InputBox("Enter Sheet Name")
For Each Sheet In ActiveWorkbook <<< Bombing here at this line !!
If ActiveSheet.Name = Temp Then
MsgBox "Found the sheet!", vbOKOnly
End If
Next
End Sub

Thanks in Advance,




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 430
Default help with debug

Thanks Tom; have printed off for "in-depth" study.
It's depressing to have worked with this stuff as long as I have
and to know as little as I do,
we all appreciate your giving-attitude.
Jim


"Tom Ogilvy" wrote in message
...
Sub FindSheet()
Dim Temp As String
Dim i As Integer
Temp = InputBox("Enter Sheet Name")
For Each Sht In ActiveWorkbook.Worksheets
If lcase(Sht.Name) = lcase(Temp) Then
MsgBox "Found the sheet!", vbOKOnly
Exit For
End If
Next
End Sub

--
Regards,
Tom Ogilvy



"Jim May" wrote in message
news:CI2Sc.17532$Bb.17221@lakeread08...
Why is this not working?

Sub FindSheet()
Dim Temp As String
Dim i As Integer
Temp = InputBox("Enter Sheet Name")
For Each Sheet In ActiveWorkbook <<< Bombing here at this line !!
If ActiveSheet.Name = Temp Then
MsgBox "Found the sheet!", vbOKOnly
End If
Next
End Sub

Thanks in Advance,






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
DeBug Ollie Excel Discussion (Misc queries) 4 April 28th 06 03:17 PM
help with debug Rusty New Users to Excel 3 February 2nd 05 03:16 AM
No debug box mushy_peas[_33_] Excel Programming 2 April 23rd 04 12:20 AM
debug - [email protected] Excel Programming 1 March 6th 04 10:32 AM
debug help Tom Ogilvy Excel Programming 0 August 27th 03 07:10 PM


All times are GMT +1. The time now is 11:55 PM.

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"