Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Jacek
This works for me if I replace the semi-colons with commas which is what is required by my settings: Cells(r, c).Formula = "=VLOOKUP($A4,[dane.xls]Sheet1!$A$2:$B$5,2,FALSE)" If you can paste the formula manually and it works then it would seem your language and international settings require semi-colons but it might be worth trying it this way just to see what result you get. Hope this helps Rowan Jacek Polar wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Problem Running Code in Excel 2003 | Excel Programming | |||
Saving Problem Excel 2000 with VBA code | Excel Programming | |||
Excel VBA - loop code problem | Excel Programming | |||
Problem with code causing Excel '97 to crash | Excel Programming | |||
Excel Query - Code problem | Excel Programming |