Closed Thread
Results 1 to 3 of 3

FormulaR1C1 not working

Hybrid View

  1. #1
    matt
    Guest

    FormulaR1C1 not working

    I wrote a macro with the following script:

    Range("B7").Select
    ActiveCell.FormulaR1C1 = _
    "=HYPERLINK(""c:/foldername/images/""&RC[-1]&"".jpg"",""Image"")"

    This works on my machine but when I delivered it to the client, the macro
    just copys the script into the cell and not the formula. In other words the
    formula does not appear to be valid. It appears as RC[-1] and not A7.

    Any ideas as to why this is happening and how I can fix it? If I go into
    the actual spreadsheet and replace RC[-1] with A7 and copy that down, the
    formula works. So the issue is with the RC[-1].

    Any help would be greatly appreciated.

    thanks

  2. #2
    Don Guillett
    Guest

    Re: FormulaR1C1 not working

    perhaps one of you needs to adjust
    tools>options>general>uncheck/check r1c1


    --
    Don Guillett
    SalesAid Software
    dguillett1@austin.rr.com
    "matt" <matt@discussions.microsoft.com> wrote in message
    news:A8DD9380-2C88-4D7D-A456-7FABB87414A5@microsoft.com...
    >I wrote a macro with the following script:
    >
    > Range("B7").Select
    > ActiveCell.FormulaR1C1 = _
    > "=HYPERLINK(""c:/foldername/images/""&RC[-1]&"".jpg"",""Image"")"
    >
    > This works on my machine but when I delivered it to the client, the macro
    > just copys the script into the cell and not the formula. In other words
    > the
    > formula does not appear to be valid. It appears as RC[-1] and not A7.
    >
    > Any ideas as to why this is happening and how I can fix it? If I go into
    > the actual spreadsheet and replace RC[-1] with A7 and copy that down, the
    > formula works. So the issue is with the RC[-1].
    >
    > Any help would be greatly appreciated.
    >
    > thanks




  3. #3
    Bernie Deitrick
    Guest

    Re: FormulaR1C1 not working

    Matt,

    Make sure that the cell is properly formatted - what you described happens if the cell if formatted
    for text. You can do it this way:

    With Range("B7")
    ..NumberFormat = "General"
    ..FormulaR1C1 = _
    "=HYPERLINK(""c:/foldername/images/""&RC[-1]&"".jpg"",""Image"")"
    End With

    HTH,
    Bernie
    MS Excel MVP


    "matt" <matt@discussions.microsoft.com> wrote in message
    news:A8DD9380-2C88-4D7D-A456-7FABB87414A5@microsoft.com...
    >I wrote a macro with the following script:
    >
    > Range("B7").Select
    > ActiveCell.FormulaR1C1 = _
    > "=HYPERLINK(""c:/foldername/images/""&RC[-1]&"".jpg"",""Image"")"
    >
    > This works on my machine but when I delivered it to the client, the macro
    > just copys the script into the cell and not the formula. In other words the
    > formula does not appear to be valid. It appears as RC[-1] and not A7.
    >
    > Any ideas as to why this is happening and how I can fix it? If I go into
    > the actual spreadsheet and replace RC[-1] with A7 and copy that down, the
    > formula works. So the issue is with the RC[-1].
    >
    > Any help would be greatly appreciated.
    >
    > thanks




Closed 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