View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Need help with an if statement

The range is multiple cells?

dim myRng as range
if application.counta(myrng) = 0 then
msgbox "all the cells in that range are empty
end if

if myRng is a single cell:
if isempty(myrng.value) then
msgbox "It's empty"
end if

SuitedAces wrote:

I have Dim a variable as a range.

I am trying to write an IF statement based on that range being empty,
and having no success.

Any help is appreciated.

--
SuitedAces
------------------------------------------------------------------------
SuitedAces's Profile: http://www.excelforum.com/member.php...o&userid=35840
View this thread: http://www.excelforum.com/showthread...hreadid=556412


--

Dave Peterson