Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hi!
You can also try with this code: Option Explicit Const cstrMandatory As String = "A:A" 'For column "A" only. Dim fIsBlank As Boolean Dim strAddress As String Private Sub Worksheet_Change(ByVal Target As Range) With Target If Not Application.Intersect(.Cells(1), _ Range(cstrMandatory)) Is Nothing Then fIsBlank = .Value = "" End If End With End Sub Private Sub Worksheet_SelectionChange(ByVal Target As Range) With Target If fIsBlank Then Application.EnableEvents = False Range(strAddress).Select MsgBox "This cell required!", vbExclamation Application.EnableEvents = True Else If Not Application.Intersect(.Cells(1), _ Range(cstrMandatory)) Is Nothing Then If .Count = 1 Then strAddress = Target.Address fIsBlank = .Value = "" End If End If End If End With End Sub Creates a "CellTrap" and you can not get out until type something. Paste this code in code module of your sheet. Cheers, John John Ο χρήστης "LOCK CELLS" *γγραψε: I WANT TO CREATE MANDATORY CELLS IN WORKSHEET. IF THE CELLS ARE BLANK THEN NOT ALLOW TO FORWARD. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Mandatory entry for a group of cells? | Excel Discussion (Misc queries) | |||
Mandatory Cells | Excel Worksheet Functions | |||
Mandatory Cells | Excel Worksheet Functions | |||
Cells to be mandatory fill have a formula in it | Excel Discussion (Misc queries) | |||
How to create mandatory cells in a worksheet | Excel Worksheet Functions |