Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default VBA "Left" not working

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 896
Default VBA "Left" not working

could you provide the code?
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default VBA "Left" not working

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)

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default VBA "Left" not working

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.

"prs16001" wrote:

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)

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default VBA "Left" not working

As ALWAYS, post your macro for comments and suggestions.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"prs16001" wrote in message
...
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.




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA "Left" not working

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


"prs16001" wrote in message
...
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.


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA "Left" not working

Just had something similar so thought I'd post this for others.

This is almost certainly a 'reference' issue.

Just goto Tools - References

You need to tick a reference that has 'Left' within it. 'lookup' definitely does... there are probably others.

The reason your code is not working is because a previously used reference is now 'missing' or has been unchecked for some reason... perhaps by another user of the spreadsheet.

On Tuesday, July 15, 2008 8:40 AM prs1600 wrote:


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.



On Tuesday, July 15, 2008 8:49 AM Don Guillett wrote:


As ALWAYS, post your macro for comments and suggestions.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software



On Tuesday, July 15, 2008 9:45 AM prs1600 wrote:


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)



On Tuesday, July 15, 2008 9:58 AM Rick Rothstein \(MVP - VB\) wrote:


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



On Tuesday, July 15, 2008 10:04 AM Charli wrote:


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.

"prs16001" wrote:



On Thursday, July 17, 2008 11:01 PM Jarek Kujawa wrote:


could you provide the code?



Submitted via EggHeadCafe - Software Developer Portal of Choice
Review of DevExpress DXperience Control Suite
http://www.eggheadcafe.com/tutorials...rol-suite.aspx
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 621
Default VBA "Left" not working

Tim

Are 2 year old posts just now showing up at EggHead?


Gord Dibben MS Excel MVP

On Thu, 21 Oct 2010 21:48:40 GMT, tim bryden
wrote:

Just had something similar so thought I'd post this for others.

This is almost certainly a 'reference' issue.

Just goto Tools - References

You need to tick a reference that has 'Left' within it. 'lookup' definitely does... there are probably others.

The reason your code is not working is because a previously used reference is now 'missing' or has been unchecked for some reason... perhaps by another user of the spreadsheet.

On Tuesday, July 15, 2008 8:40 AM prs1600 wrote:


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.



On Tuesday, July 15, 2008 8:49 AM Don Guillett wrote:


As ALWAYS, post your macro for comments and suggestions.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software



On Tuesday, July 15, 2008 9:45 AM prs1600 wrote:


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)



On Tuesday, July 15, 2008 9:58 AM Rick Rothstein \(MVP - VB\) wrote:


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



On Tuesday, July 15, 2008 10:04 AM Charli wrote:


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.

"prs16001" wrote:



On Thursday, July 17, 2008 11:01 PM Jarek Kujawa wrote:


could you provide the code?



Submitted via EggHeadCafe - Software Developer Portal of Choice
Review of DevExpress DXperience Control Suite
http://www.eggheadcafe.com/tutorials...rol-suite.aspx

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
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
Replace(ActiveCell.Formula, "Round(","") not working as expected Dennis Excel Programming 3 May 16th 07 04:49 PM
HELP on "left","right","find","len","substitute" functions serene83 Excel Discussion (Misc queries) 5 June 27th 06 02:23 AM
Working out age from "Day" "Month" "Year" timmyc Excel Worksheet Functions 4 February 5th 06 03:07 PM
Conflict with "Right" / "Left" Command DJB[_7_] Excel Programming 4 August 31st 05 10:50 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"