View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Claus Busch Claus Busch is offline
external usenet poster
 
Posts: 3,872
Default Runtime error 1004 when trying to insert formula in cells

Hi Jan,

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

I have a sheet with some numbers in some cells, while other celles are empty. Now I try to replace the numbers with a certain formula, but it returns a runtime error 1004, Application-defines og obeject-defined error.


=IF(VLOOKUP($A31,Opslag!$A:$M,F$1,FALSE)0,VLOOKUP ($A31,Opslag!$A:$M,F$1,FALSE),"")


try:

Sub FyldUdfyldte()
Dim c As Range
Dim Indhold As String

Indhold = InputBox("Type needed formula")

For Each c In Selection
If Not IsEmpty(c) Then c.Formula = Indhold
Next c
End Sub


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