View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jacek Polar Jacek Polar is offline
external usenet poster
 
Posts: 2
Default VBA code in excel problem

Of course I cut my code, sorry:
Cells(r,c).Formula = "=VLOOKUP($A4;[dane.xls]Sheet1!$A$2:$B$5;2;FALSE)"

Regards,
Jacek

Użytkownik "Jacek Polar" napisał w wiadomości
...
Hi,

I'd like to fill some numbers of Excel 2000 cells with a formula,
so I wrote code in VBA (see below):

Cells(r,c).Formula = "=VLOOKUP($A4;[dane.xls]
where r - row, c - col, $A4 - cell with searching string

When I run VBA code I see error message:
Run-time error 1004:
Application-defined or object-defined error.

When I paste the formula into cell or type it everything is ok,
only VBA code makes problem.
What could be wrong, how should I solve the problem.
Thanks in advance.

Regards,
Jacek