VBA "Left" not working

  • Thread starter Thread starter prs16001
  • Start date Start date
P

prs16001

I have a macro that I've been using for about a year and just recently I'm
getting a "compile error: wrong number of arguments or invalid property
assignment" on the Left function (Visual Basic for Applications).

As far as I know, nothing has changed and I'm still using Excel 2003 with SP2.
 
The full code is several hundred lines and this is the line where it gets the
compile error. This is also the first use of the Left function. As I stated
before, I've been using this with no errors for the past year and now I'm
getting a compile error. lot_ed and lotidLen are dimensioned as variant.


lot_ed = Left(RegWB.Worksheets("NSR" & StepNum & "ED").Cells(j, 3).Value,
lotidLen)
 
It sounds like you may have lost one (or more) references. Try clicking
Tools/References on the VB editor menu bar and put a check mark next to any
that are marked as missing.

Rick
 
The error is probably in the

RegWB.Worksheets("NSR" & StepNum & "ED").Cells(j, 3).Value

Make sure object RegWB is still set, examine the values of StepNum and j,
and make sure the worksheet "NSR" & StepNum & "ED" still exists, etc.
 

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

XNPV in VBA 2
Help me fix this function 0
VBA compile error with Split Text Function 1
Can VB execute VBA code? 4
Date Format 7
Excel 2003 VBA help problem 3
Excel VBA 1
VBA to select font/colour not working 1

Back
Top