Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Field Required if another field is checked

"F14 Required if F22 or F23 is checked unless it already
has information in it."
Here what I want to do

If F14 hasn't got any information in it and you Enter an X
in F22 or F23 which turns F14 red. and automatically
places the curser or tabs to F14. Then you enter
information in F14 and F14 loses it red color.
If F14 has information in it then the above is ignored and
you proceed like normal to the next field.

This is a big one so THANKS A BUNCH.

Using
Office 2000
NT 4.0

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 576
Default Field Required if another field is checked

Kelly,

Right click on the sheet tab and paste this into the worksheet module

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address = "$F$22" Or Target.Address = "$F$23" Then
If UCase(Target) = "X" Then
If Len(Range("F14")) = 0 Then
Range("F14").Interior.ColorIndex = 3
Range("F14").Select
MsgBox ("Make an entry")
End If
End If
End If
End Sub

note the MsgBox to alert the user to make an entry.

You can make this more generic so that it will work on any field.
Instead of Target.Address you can use Target.Row = 22 and
Target.Row = 23. Instead of Range("F14") you can use
Cells(14,Target.Column)

And you can restrict it with another If
If Target.Column 5 then
....

--
sb
"** Kelly ********" wrote in message
...
"F14 Required if F22 or F23 is checked unless it already
has information in it."
Here what I want to do

If F14 hasn't got any information in it and you Enter an X
in F22 or F23 which turns F14 red. and automatically
places the curser or tabs to F14. Then you enter
information in F14 and F14 loses it red color.
If F14 has information in it then the above is ignored and
you proceed like normal to the next field.

This is a big one so THANKS A BUNCH.

Using
Office 2000
NT 4.0



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
How to make a field created a part of the Pivot Table Field List? drhell Excel Discussion (Misc queries) 0 January 29th 07 11:13 PM
Linked date field in worksheet defaults a blank field as 1/0/1900 AmnNkD Excel Worksheet Functions 2 September 12th 06 05:42 PM
can I make a field in excel spreadsheet required? If yes, How? Ginycub22 Excel Discussion (Misc queries) 0 August 23rd 06 08:30 PM
Required Field tiab86 Excel Worksheet Functions 0 April 6th 06 09:33 PM
Required field message - Excel Steve S via OfficeKB.com Excel Discussion (Misc queries) 2 May 9th 05 04:16 PM


All times are GMT +1. The time now is 06:57 PM.

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"