View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Randy Randy is offline
external usenet poster
 
Posts: 213
Default IsNotEmpty Range

Thanks Dave....you are awesome as always! Now I have another question for
you....rows 14-38 are visible....rows 39-83
are hidden unless the user clicks a botton that makes rows 39-83 visible...is
there a way I can get this to work on rows 39-83 when they are visible only?

--
Randy Street
Rancho Cucamonga, CA


"Dave Peterson" wrote:

I'd try:

Private Sub Sr_Mgr_Click()

with workSheets("Sr-Area Manager").Range("D14:D63")
if .cells.count = application.counta(.cells) then
'all the cells have something in them
else
'not all the cells have something in them
end if
end with

End Sub

Remember that formulas that evaluate to ="" (looking empty) still count as
having something in them.

Randy wrote:

Hello...I have a little vb code tht I am trying to get to work with a range
of cells. Basically if any of the cells in the range are empty it should
return a message. the code works if a single cell (such as D14) is used but
not when I put the range (such as D14:D63). Anyone have any ideas as to how I
can get this to work without listing each cell individually?

here is what I hve so far:

Private Sub Sr_Mgr_Click()
If IsEmpty(Sheets("Sr-Area Manager").Range("D14:D63")) Then
r = MsgBox("You are missing a Move-In Date. Move-In Dates are a
required field. Please verify you have ALL Move-In Dates entered before
continuing!", _
vbQuestion + vbOKOnly, "Error?")
If r = vbOK Then
Range("D14").Select
End
End If

End If
End Sub
--
Randy Street
Rancho Cucamonga, CA


--

Dave Peterson
.