Results 1 to 7 of 7
  1. #1
    3 Star Lounger
    Join Date
    Oct 2004
    Location
    Houston, Texas, USA
    Posts
    242
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Variable Sizes (Excel 2003)

    I have a macro that takes the cell content of one cell, adds the date which lives in another cell and replaces the first cell with the combined value. Works like a charm until I get to certain cells. Then I get an error message that says:
    'Application defined or object defined error'. The only thing I can think of is that the amount of text in the cells where the macro blows up seems to be larger than in the others. I have declared the variable that stores the text as variant - did not help.

    Any ideas anybody?

    Thanks,
    itconc

  2. #2
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Variable Sizes (Excel 2003)

    Could you show us your code please?
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  3. #3
    3 Star Lounger
    Join Date
    Oct 2004
    Location
    Houston, Texas, USA
    Posts
    242
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Variable Sizes (Excel 2003)

    I have asted the code into a word document and marked where it blows up. Thanks for looking at this.
    itconc

  4. #4
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Variable Sizes (Excel 2003)

    A formula may not be more than 1024 characters, maybe you hit this limit?

    Maybe you can simply replace all occurances of FOrmulaR1C1 with Value in the macro code.
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  5. #5
    3 Star Lounger
    Join Date
    Oct 2004
    Location
    Houston, Texas, USA
    Posts
    242
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Variable Sizes (Excel 2003)

    Thanks, I did and it worked. I had replaced the one where the macro blew up but not all of them - it did not work. However, when I replaced all of them it worked. What is the difference between the two ways?

    Thanks a million!

    itconc

    itconc

  6. #6
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Variable Sizes (Excel 2003)

    If you use the FOrmulaR1C1 property, you are in fact trying to insert a formula in a cell. This isn't needed in your case, since you are using simple text. The Value of a cell can be as much as 64000 characters long (but only about the first 1000 are shown!!)
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  7. #7
    3 Star Lounger
    Join Date
    Oct 2004
    Location
    Houston, Texas, USA
    Posts
    242
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Variable Sizes (Excel 2003)

    Thanks for the explanation!
    Thank you again for your help,

    IT

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •