#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default LTrim

I'm getting an error for the following code:

Dim strText1 As String, strText2 As String
....
strText2 = LTRIM(strText1)

The error is "Wrong number of arguments or invalid property assignment"

The code looks exactly like the example in the help file. Anyone know why
am I getting this error?



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 391
Default LTrim

Looks fine to me...in a standard module:
Sub Test1()
MsgBox MyTrim(" A B C ")
End Sub
Function MyTrim(strText1 As String) As String
Dim strText2 As String
strText2 = LTrim(strText1)
MyTrim = strText2
End Function

I used a function so that it could be called from a sub
as in the test above, or from a worksheet cell.

Patrick Molloy
Microsoft Excel MVP


-----Original Message-----
I'm getting an error for the following code:

Dim strText1 As String, strText2 As String
....
strText2 = LTRIM(strText1)

The error is "Wrong number of arguments or invalid

property assignment"

The code looks exactly like the example in the help

file. Anyone know why
am I getting this error?



.

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
I can't seem to use RTRIM or LTRIM in Excel 2002. I want to trim. Pam New Users to Excel 3 December 2nd 04 12:08 AM


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