View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
programmernovice[_2_] programmernovice[_2_] is offline
external usenet poster
 
Posts: 61
Default Help with named-cell referencing

I have two open workbooks:

SPX-BS.xlsm and

Book1.xlsm

There is a cell named "premium" in SPX-BS which I need to access from a macro to post the value to Book1. If I enter manually

'SPX-BS.xlsm'!premium into a cell on Book1 it works fine. However if, within a macro I type

Range("A7") = 'SPX-BS.xlsm'!premium

I get an "Compile Error Syntax Error" message.

Can someone please advise what I'm doing wrong? Many thanks in advance.