Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 124
Default Help with code...

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default Help with code...

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 124
Default Help with code...

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
split post code (zip code) out of cell that includes full address Concord Excel Discussion (Misc queries) 4 October 15th 09 06:59 PM
Code to conditional format all black after date specified in code? wx4usa Excel Discussion (Misc queries) 3 December 26th 08 07:06 PM
Drop Down/List w/Code and Definition, only code entered when selec Spiritdancer Excel Worksheet Functions 2 November 2nd 07 03:57 AM
stubborn Excel crash when editing code with code, one solution Brian Murphy Excel Programming 0 February 20th 05 05:56 AM
VBA code delete code but ask for password and unlock VBA protection WashoeJeff Excel Programming 0 January 27th 04 07:07 AM


All times are GMT +1. The time now is 10:31 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"