Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Runtime error 1004 when trying to insert formula in cells

Sorry to have kept you waiting, suddenly had to Work :-(

The formula Works, when I type it in a cell, but wont be inserted via VBA.

I have to sheets, with app. 140.000 cells, from A1 to DU1140. Both sheets has Unique numbers in column A and headers in row 1. The first sheet contains actual prizes, for different items. There are only prizes in some cells, and what cells are empty and filled are not patterned in any way, its almost random.

The otherf hseet is updated with new prizes, which can be in same or other cells as in sheet 1. Now I want to insert a lookup formula in the cells, and only the cells in sheet 1, that has already numbers in them. This formula should look up prizes in sheet 2, if such exist and return them to sheet 1, if the corresponding cell in sheet one is not empty. If it is, should not be inserted.

As I mentioned the formula works if I type it, but I can'øt see why the VBA code suddenly fails, when it works with other, shorter formulas.

Jan

Den søndag den 26. oktober 2014 13.11.38 UTC+1 skrev Claus Busch:
Hi Jan,

Am Sun, 26 Oct 2014 04:45:24 -0700 (PDT) schrieb

:

=IF(IF(ISERROR(VLOOKUP($B1147,'JK-prisfil'!$C:$HG,DV$1,FALSE)),VLOOKUP($B1147,'2015p riser'!$B:$HG,DV$1,FALSE),VLOOKUP($B1147,'JK-prisfil'!$C:$HG,DV$1,FALSE))=0,ROUND(VLOOKUP($B114 7,'2015priser'!$B:$HG,DV$2,FALSE),0),ROUND(IF(ISER ROR(VLOOKUP($B1147,'JK-prisfil'!$C:$HG,DV$1,FALSE)),VLOOKUP($B1147,'2015p riser'!$B:$HG,DV$1,FALSE),VLOOKUP($B1147,'JK-prisfil'!$C:$HG,DV$1,FALSE)),0))


your formula is wrong. Tell us in words what you want to calculate


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
unable to protect cells in macro sheet b/c runtime error 1004 rldjda Excel Worksheet Functions 1 March 20th 08 08:28 PM
runtime 1004 error on deleting rows with blank cells Janis Excel Programming 5 July 18th 07 09:38 PM
Runtime 1004 error -- insert method of range class failed. tish Excel Discussion (Misc queries) 1 June 1st 07 04:04 PM
Runtime 1004 error when insert. mikewild2000[_33_] Excel Programming 2 March 8th 06 10:48 PM
Runtime 1004 error when insert. mikewild2000[_32_] Excel Programming 0 March 8th 06 07:21 PM


All times are GMT +1. The time now is 02:05 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"