Help in Mandatory cells for my project tracking sheet

karthik537

New Member
Joined
Jul 30, 2011
Messages
8
Hi Friends,

I have 3 columns(A,B & C) in which Column A contains Start Date , Column B contains End Date and Column C will be the total no. of hrs that should be calculated from Start Date and End Date. Now I want the user to compulsorily enter the Start Date and End date (I mean they should not be left blank). Let's say if the user didn't enter the Start and End date blank and if he tries to enter the no. of hours in Column C, an error should be displayed saying that "Column A & B cannot be blank".

Please help me asap as I need it for my project tracking.
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
What about locking Col C to disallow entry.
Leaving population of A&B the only option to populate C?
 
Upvote 0
Hi...

I dont want the exact no. of hours between start date and end date... I require these no. of hrs to validate like user shouldn't enter more than the no. of hours between the start and end date.
 
Upvote 0
I might have been misunderstood - or I'm confused...

What about locking Col C to disallow entry.
Leaving population of A&B the only option to populate C?
What I'm saying in the above post is that the user would not enter the total hours in Col C.
The hours would be entered by a formula in C based on values of A & B.
With Col C locked, the only way to change the hours in C would be to change the Start or End entries.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If you did understand what I meant and that won't work for you then
you might use the Worksheet_Change event to look at A&B after C is updated:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Column = 3 Then
        If Target.Offset(, -2) = "" And Target.Offset(, -1) = "" Then
            MsgBox "Cols A&B are blank"
            Application.EnableEvents = False
            Target = ""
            Target.Select
            Application.EnableEvents = True
            Exit Sub
        End If
        If Target.Offset(, -2) = "" Then
            MsgBox "Col A is blank"
            Application.EnableEvents = False
            Target = ""
            Target.Select
            Application.EnableEvents = True
            Exit Sub
        End If
        If Target.Offset(, -1) = "" Then
            MsgBox "Col B is blank"
            Application.EnableEvents = False
            Target = ""
            Target.Select
            Application.EnableEvents = True
            Exit Sub
        End If
    End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,522
Messages
6,179,297
Members
452,903
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top