View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
John James
 
Posts: n/a
Default Cell can not be blank


Hi Todd,

Just comment out the MsgBox lines and the spreadsheet forces you into a
single cell selection until all forced selections are made - without any
annoying messages. The message seems redundant if there's no other
choice.

Is this what you want?




Todd Wrote:
That's what I tried and when you tab over to cell b1 it gives you the
mesage
box first before leaving the cell. I need it to only come up if you
leave
the cell.

"CLR" wrote:
Maybe something like this, just for two cells...could be expanded

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
If Not Range("a1").Value < "" Then
MsgBox "cant do that"
Range("a1").Select
ElseIf Not Range("b1").Value < "" Then
MsgBox "cant do that"
Range("b1").Select
End If
End Sub

hth
Vaya con Dios,
Chuck, CABGx3




--
John James
------------------------------------------------------------------------
John James's Profile: http://www.excelforum.com/member.php...o&userid=32690
View this thread: http://www.excelforum.com/showthread...hreadid=532705