Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I'm using the following code to make the user enter data into cells E7: BF7 before they enter data into cells E9:BF1000 It's working great! But, now I want to try to modify the code for another worksheet where I only need to apply this to column A. I need to not allow the user to enter data into cells A10:A1000 unless they have entered data into cell A9. I've tried to alter this code to do that...but I had no luck!! If Target.Cells.Count 1 Then Exit Sub If Target.Cells(1).Row = 9 _ And Target.Cells(1).Row <= 1000 _ And Target.Cells(1).Column = 5 _ And Target.Cells(1).Column <= 58 Then If Target.Parent.Cells(7, Target.Cells(1).Column).Value = "" Then Application.EnableEvents = False Application.Undo Application.EnableEvents = True MsgBox " This column needs a heading!!You must enter a heading in cell 7 above. Once the heading is entered into cell 7, you will be able to enter data into this column.", vbOKOnly, "Column Label Required in Cell & above" Target.Parent.Cells(7, Target.Cells(1).Column).Select End If End If Any help is greatly appreicated!!! Thanks in advance! Kimberly |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try (untested):
If Target.Cells.Count 1 Then Exit Sub If Target.Cells(1).Row = 10 _ And Target.Cells(1).Row <= 1000 _ And Target.Cells(1).Column = 1 _ Then If Target.Parent.Cells(9, Target.Cells(1).Column).Value = "" Then Application.EnableEvents = False Application.Undo Application.EnableEvents = True MsgBox " This column needs a heading!!You must enter a heading in cell 9 above. Once the heading is entered into cell 9, you will be able to enter data into this column.", vbOKOnly, "Column Label Required in Cell & above" Target.Parent.Cells(9, Target.Cells(1).Column).Select End If End If -- Vasant "KimberlyC" wrote in message ... Hi, I'm using the following code to make the user enter data into cells E7: BF7 before they enter data into cells E9:BF1000 It's working great! But, now I want to try to modify the code for another worksheet where I only need to apply this to column A. I need to not allow the user to enter data into cells A10:A1000 unless they have entered data into cell A9. I've tried to alter this code to do that...but I had no luck!! If Target.Cells.Count 1 Then Exit Sub If Target.Cells(1).Row = 9 _ And Target.Cells(1).Row <= 1000 _ And Target.Cells(1).Column = 5 _ And Target.Cells(1).Column <= 58 Then If Target.Parent.Cells(7, Target.Cells(1).Column).Value = "" Then Application.EnableEvents = False Application.Undo Application.EnableEvents = True MsgBox " This column needs a heading!!You must enter a heading in cell 7 above. Once the heading is entered into cell 7, you will be able to enter data into this column.", vbOKOnly, "Column Label Required in Cell & above" Target.Parent.Cells(7, Target.Cells(1).Column).Select End If End If Any help is greatly appreicated!!! Thanks in advance! Kimberly |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks!!!
That worked great! :) "Vasant Nanavati" <vasantn AT aol DOT com wrote in message ... Try (untested): If Target.Cells.Count 1 Then Exit Sub If Target.Cells(1).Row = 10 _ And Target.Cells(1).Row <= 1000 _ And Target.Cells(1).Column = 1 _ Then If Target.Parent.Cells(9, Target.Cells(1).Column).Value = "" Then Application.EnableEvents = False Application.Undo Application.EnableEvents = True MsgBox " This column needs a heading!!You must enter a heading in cell 9 above. Once the heading is entered into cell 9, you will be able to enter data into this column.", vbOKOnly, "Column Label Required in Cell & above" Target.Parent.Cells(9, Target.Cells(1).Column).Select End If End If -- Vasant "KimberlyC" wrote in message ... Hi, I'm using the following code to make the user enter data into cells E7: BF7 before they enter data into cells E9:BF1000 It's working great! But, now I want to try to modify the code for another worksheet where I only need to apply this to column A. I need to not allow the user to enter data into cells A10:A1000 unless they have entered data into cell A9. I've tried to alter this code to do that...but I had no luck!! If Target.Cells.Count 1 Then Exit Sub If Target.Cells(1).Row = 9 _ And Target.Cells(1).Row <= 1000 _ And Target.Cells(1).Column = 5 _ And Target.Cells(1).Column <= 58 Then If Target.Parent.Cells(7, Target.Cells(1).Column).Value = "" Then Application.EnableEvents = False Application.Undo Application.EnableEvents = True MsgBox " This column needs a heading!!You must enter a heading in cell 7 above. Once the heading is entered into cell 7, you will be able to enter data into this column.", vbOKOnly, "Column Label Required in Cell & above" Target.Parent.Cells(7, Target.Cells(1).Column).Select End If End If Any help is greatly appreicated!!! Thanks in advance! Kimberly |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
split post code (zip code) out of cell that includes full address | Excel Discussion (Misc queries) | |||
Code to conditional format all black after date specified in code? | Excel Discussion (Misc queries) | |||
Drop Down/List w/Code and Definition, only code entered when selec | Excel Worksheet Functions | |||
stubborn Excel crash when editing code with code, one solution | Excel Programming | |||
VBA code delete code but ask for password and unlock VBA protection | Excel Programming |