Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 516
Default 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
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default 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" wrote in message
...
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



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
Formular1c1 Steph[_3_] Excel Programming 2 June 30th 05 09:12 PM
FormulaR1C1 Aksel Børve Excel Programming 2 February 28th 05 09:52 PM
FormulaR1C1 D.S.[_3_] Excel Programming 2 January 2nd 04 12:03 AM
FormulaR1C1 D.S.[_3_] Excel Programming 0 January 1st 04 09:12 PM
FormulaR1C1 aapp81[_22_] Excel Programming 3 December 3rd 03 10:47 PM


All times are GMT +1. The time now is 07:19 PM.

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

About Us

"It's about Microsoft Excel"