Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
FormulaR1C1 not working
perhaps one of you needs to adjust
toolsoptionsgeneraluncheck/check r1c1 -- Don Guillett SalesAid Software "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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Formular1c1 | Excel Programming | |||
FormulaR1C1 | Excel Programming | |||
FormulaR1C1 | Excel Programming | |||
FormulaR1C1 | Excel Programming | |||
FormulaR1C1 | Excel Programming |