Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 109
Default Compile error

Hi all

I've received a worksheet from a colleague, when trying to run a macro,
I get a compile error - 'Cannot find project or library'

Code stops at --- hilltest = LCase(hilltest)

with LCase highlighted.

Can anyone explain the problem? Code below

---------------------------------------------------------------------------

Sub NameSearch(xtest)
Dim myName As String
Dim i As Integer, idb As Integer, myrow As Integer
Dim hilltest As String
'Dim xtest As Integer

idb = 3688

myName = Application.InputBox("Choose a Hill: You can use * as a
wildcard", Type:=2 + 4)

If myName = "False" Then
Exit Sub
End If

If myName = "" Then
Do While myName = ""
MsgBox ("You must enter a Hill Name")
myName = Application.InputBox("Choose a Hill: You can use * as a
wildcard", Type:=2 + 4)

If myName = "False" Then
Exit Sub
End If

Loop
End If

Sheets("Hills").Select
'MsgBox myName
For i = 2 To idb
Application.ScreenUpdating = False
ActiveSheet.Cells(i, 3).Select
hilltest = ActiveSheet.Cells(i, 3).Value
hilltest = LCase(hilltest)
myName = LCase(myName)

If hilltest Like myName Then
Application.ScreenUpdating = True
myrow = i
ActiveSheet.Rows(myrow).Select
xtest = MsgBox("Is this the Hill you want?", 3, "Search Result")

If xtest = 6 Then
Exit Sub
End If
If xtest = 2 Then
Exit Sub
End If
End If

'For i = 1 To 10
'On Error GoTo CheckFiles_Err
'ActiveSheet.Cells.Find(What:=myName, After:=ActiveCell, LookIn:=xlFormulas,
LookAt:=xlWhole, _
'SearchOrder:=xlByColumns, SearchDirection:=xlNext,
MatchCase:=False).Activate
'myName = InputBox("Choose a hill; * acts as a wild card, now Click
Cancel to make this selection or OK to continue looking for another hill",
"Hill Name", myName)
'If myName = "" Then
' Exit Sub
'End If
'Next i

'myName = True
'CheckFiles_Err: MsgBox "The Hill name you entered is not in the Database"

Next i

Sheets("Options").Select
MsgBox ("The Hill you entered is not in the Database")
End Sub

Many thanks
George Gee


  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 206
Default Compile error

Check This out
http://support.microsoft.com/default.aspx/kb/166273
  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 109
Default Compile error

CurlyDave

Thanks for the link, problem solved.

George Gee


"CurlyDave" wrote in message
...
Check This out
http://support.microsoft.com/default.aspx/kb/166273



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
Solver - error - Compile Error Nina Excel Discussion (Misc queries) 0 August 19th 08 09:41 PM
help with this error-Compile error: cant find project or library JackR Excel Discussion (Misc queries) 2 June 10th 06 09:09 PM
VBA Error Message "Compile Error...." Steve Excel Discussion (Misc queries) 3 July 15th 05 09:20 AM
How do I get rid of "Compile error in hidden module" error message David Excel Discussion (Misc queries) 4 January 21st 05 11:39 PM


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

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"