Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Complie error: can't find project or library

Hi, the "left" is creating error. I am trying to delete "cu" if it represents
the first two characters in the cell.

Sub Step8_CleanUpAllSheet()

Dim r As Integer


For r = Cells(65536, 4).End(xlUp).Row To 2 Step -1


If Left(Cells(r, 4), 2) = "cu" Then
Cells(r, 4).TextToColumns Destination:=Cells(r, 4),
DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 9), Array(2, 1)),
TrailingMinusNumbers:=True
End If
Next r


End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default Complie error: can't find project or library

In the VB Editor Click on Tools - References. Look for anything that is
checked but indicates Missing. This is actually where your run time error is
coming from. It actually has nothing to do with the Left fucntion as you
might imagine (One of the quirks of VBA).

Chances are you can just uncheck the reference and your code will run with
no problems. If after unchecking however your code no longer compiles then
you need to go looking for a versio of the missing reference that does exist
on your system and add that in.
--
HTH...

Jim Thomlinson


"Tony D" wrote:

Hi, the "left" is creating error. I am trying to delete "cu" if it represents
the first two characters in the cell.

Sub Step8_CleanUpAllSheet()

Dim r As Integer


For r = Cells(65536, 4).End(xlUp).Row To 2 Step -1


If Left(Cells(r, 4), 2) = "cu" Then
Cells(r, 4).TextToColumns Destination:=Cells(r, 4),
DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 9), Array(2, 1)),
TrailingMinusNumbers:=True
End If
Next r


End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Complie error: can't find project or library

TD,
The "TrailingMinusNumbers:=True" argument is not available in xl97 and xl2000.
Try inserting an apostrophe just ahead of the last comma in "FieldInfo:=...
Jim Cone
San Francisco, USA

"Tony D" wrote in message
...
Hi, the "left" is creating error. I am trying to delete "cu" if it represents
the first two characters in the cell.

Sub Step8_CleanUpAllSheet()
Dim r As Integer
For r = Cells(65536, 4).End(xlUp).Row To 2 Step -1
If Left(Cells(r, 4), 2) = "cu" Then
Cells(r, 4).TextToColumns Destination:=Cells(r, 4),
DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 9), Array(2, 1)), TrailingMinusNumbers:=True
End If
Next r
End Sub
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
Compile error: Can't find project or library Melanie New Users to Excel 14 August 21st 09 02:54 AM
Can't Find Project or Library Error Vick Excel Discussion (Misc queries) 1 May 17th 08 12:25 PM
can't find project or library - error Chris T-M New Users to Excel 4 January 18th 07 10:23 PM
Error:Can't find project or library Casey[_19_] Excel Programming 9 August 13th 05 09:53 AM
Comple Error Cannot Find Project or Library ExcelMonkey[_190_] Excel Programming 13 March 22nd 05 06:24 PM


All times are GMT +1. The time now is 09:06 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"