Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
I need to expand my code for mandatory cell entry - Need help!!
I have inserted the following code into my workbook to force data entry in F3
in my worksheet - thanks to some wonderful help from members of this forum it works perfectly!! Private Sub Worksheet_SelectionChange(ByVal Target As Range) Set colf = Range("F3") Set t = Target If Intersect(t, colf) Is Nothing Then If Checklit Then If colf.Value = "" Then Application.EnableEvents = False colf.Select Application.EnableEvents = True Else Checklit = False End If End If Else Checklit = True End If End Sub However, I now need to be able to force data entry whenever the user clicks on the following ranges: F3:f50, G3:g50, and I3:I50. Can someone help me? I'm so frustrated........ Thanks - Cindyb |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
I need to expand my code for mandatory cell entry - Need help!!
Cindy, the easiest way is to create a range name for the ranges and call it
say InputRange. The Named range will look something like =Sheet5!$F$3:$C$50,Sheet5!$g$3:$F$50,Sheet5!$I$3:$ I$50 then just change the code to Private Sub Worksheet_SelectionChange(ByVal Target As Range) Set colf = Range("InputRange") Should still work perfectly Peter "CindyB" wrote: I have inserted the following code into my workbook to force data entry in F3 in my worksheet - thanks to some wonderful help from members of this forum it works perfectly!! Private Sub Worksheet_SelectionChange(ByVal Target As Range) Set colf = Range("F3") Set t = Target If Intersect(t, colf) Is Nothing Then If Checklit Then If colf.Value = "" Then Application.EnableEvents = False colf.Select Application.EnableEvents = True Else Checklit = False End If End If Else Checklit = True End If End Sub However, I now need to be able to force data entry whenever the user clicks on the following ranges: F3:f50, G3:g50, and I3:I50. Can someone help me? I'm so frustrated........ Thanks - Cindyb |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
mandatory cell | Excel Discussion (Misc queries) | |||
Mandatory entry for a group of cells? | Excel Discussion (Misc queries) | |||
Mandatory cell | Excel Discussion (Misc queries) | |||
Cell to be mandatory fill in | Excel Discussion (Misc queries) | |||
Making Cell Entry Mandatory | Excel Discussion (Misc queries) |