View Poll Results: Did you find this posting useful?

Voters
0. This poll is closed
  • Yes

    0 0%
  • No

    0 0%
Multiple Choice Poll.
+ Reply to Thread
Results 1 to 7 of 7

Need to Convert Formula R1C1 into A1-style but the Formula String exceeds 255 characters

  1. #1
    Registered User
    Join Date
    04-02-2012
    Location
    Sunnyvale, California
    MS-Off Ver
    Excel 2010
    Posts
    5

    Need to Convert Formula R1C1 into A1-style but the Formula String exceeds 255 characters

    Hi - I have run into a problem where I am converting a formula in R1C1 format to A1-style. I am using a formula conversion function that works fine as long as the length of the original formula string is less than 256 characters.
    For example,
    Original formula: "=R4C5*R7C5+R4C6*R7C6+R4C6*R7C7...." (Formula Length < 256)
    Converted formula "=$E$4*$E$7+$F$4*$F$7+$G$4*$G$7...." (Formula conversion works fine)

    But when the code gets to Row 10 and above, the formula string length exceeds 256 characters and the resulting value in my cell is "#Value". Here is a module of code where I have replaced most of the For-Next variable counters with constants. Is there a better way to generate the formula where I do not have to convert from R1C1-style to A1-style?

    Please Login or Register  to view this content.

  2. #2
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: Need to Convert Formula R1C1 into A1-style but the Formula String exceeds 255 characte

    Perhaps the code could create an equivalent SUMPRODUCT() formula instead?
    Gary's Student

  3. #3
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Need to Convert Formula R1C1 into A1-style but the Formula String exceeds 255 characte

    Do you need a poll for this question? I have closed it considering that you are new to this forum.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  4. #4
    Registered User
    Join Date
    04-02-2012
    Location
    Sunnyvale, California
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Need to Convert Formula R1C1 into A1-style but the Formula String exceeds 255 characte

    Hi JakobShavn,
    Thanks for your suggestion. I will look up the SUMPRODUCT() formula and see if this will be an alternate way to generate this long formula. - VBA_Gary

  5. #5
    Registered User
    Join Date
    04-02-2012
    Location
    Sunnyvale, California
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Need to Convert Formula R1C1 into A1-style but the Formula String exceeds 255 characte

    A fix has been found.
    The problem was that I started using the R1C1-style format rather than A1-style format for building my formula. The easier way to do it was to use the ADDRESS object as shown below. Since my formula used both relative and absolute addressing, the Evaluate(ADDRESS) method allowed me to create the formula using the 4 different options.

    Thanks to those that added their comments.

    Please Login or Register  to view this content.

  6. #6
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Need to Convert Formula R1C1 into A1-style but the Formula String exceeds 255 characte

    @ VBA_Gary

    Based on your last post it seems that you solved your issue but you haven't marked your thread as SOLVED. I'll do that for you now but please keep in mind for your future threads that Rule #9 requires you to do that yourself. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

  7. #7
    Registered User
    Join Date
    04-02-2012
    Location
    Sunnyvale, California
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Need to Convert Formula R1C1 into A1-style but the Formula String exceeds 255 characte

    Thanks Cutter for marking this as SOLVED. I looked around the website for the way to mark it as solved but did not find it. I now see it under the Thread Tools tab. Thanks for your help. - VBA_Gary

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1