View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Jarek Kujawa[_2_] Jarek Kujawa[_2_] is offline
external usenet poster
 
Posts: 896
Default Formula Problem in macro

Barb is right
you need to point to a specific worksheet which has not been done

On 11 Gru, 19:55, Barb Reinhardt
wrote:
You are not referencing the sheet at all. *It won't work unless the sheet is
referenced
--
HTH,
Barb Reinhardt

If this post was helpful to you, please click YES below.



"Stephen" wrote:
I see what your saying but no good.


ChDir "M:\FDR\Human Resources\Phone Lists"
Workbooks.Open Filename:="M:\FDR\Human Resources\Phone Lists\Management
Phone List.xls"


Range("A5").Select
ActiveCell.FormulaR1C1 = "=IF('M:\FDR\Human Resources\Phone Lists\Executive
Phone List.xls'!A5="","",'M:\FDR\Human Resources\Phone Lists\Executive Phone
List.xls'!A5)"
Range("B7").Select


still produces:


#NAME?


any more thoughts?


"ryguy7272" wrote:


I think you need the full reference to the file. *I see the file name, but
not the full path. *Excel is searching for the file and can't find it.


Does this work for you?
='[Executive Phone List.xls]Sheet1'!$A$1


Start the macro recorder, open the source, reference, whatever, link, and
turn off the recorder.


Regards,
Ryan---


--
RyGuy


"Stephen" wrote:


Hi Folks,


This seems strange to me... I have a formula which works fine...
=IF('Executive Phone List.xls'!A5="","",'Executive Phone List.xls'!A5)
but when I try to insert that via a macro I get an error.


Range("A5").Select
ActiveCell.FormulaR1C1 = "=IF('Executive Phone List.xls'!A5="","",'Executive
Phone List.xls'!A5)"


Produces:


#NAME?


TIA,


Steve- Ukryj cytowany tekst -


- Pokaż cytowany tekst -