LTrim

  • Thread starter Thread starter Dave B
  • Start date Start date
D

Dave B

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?
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Encoding question 1
retrieve text from table in .doc file 1
vba problem with lookup 4
Looping Macro to scrap multiple pages in Mainframe 2
Date Format 7
Slow Code 9
Date Format 3
LTRIM Problem 3

Back
Top