excel - Checking if cell is empty with VBA -


nom_1 name of cell in worksheet, , used in following code. someimes cell left empty , don't want norminv function called because return error if inputs empty.

i error: unable norminv property of worksheetfunction class

this leads me believe if statement incorrect , allowing code enter , execute if nom_1 empty.

if not isempty(nom_1) internal_1 = application.worksheetfunction.norminv(rnd(), n_1, std_1) end if 

am correctly checking if cell empty?

just expanding on barranka's comment,

you need make sure cells names nom_1 ,n_1,std_1,internal_1 exist in workbook

then use range("nom_1") instead of nom_1

sub mynorminv()  if not isempty(range("nom_1")) range("internal_1") = application.worksheetfunction.norminv(rnd(), range("n_1"), range("std_1")) end if  end sub 

Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -