Data Validation?

JackDanIce

Well-known Member
Joined
Feb 3, 2010
Messages
9,922
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have a table of 30 days (day numbers are headers in the top row), where I need to ensure a user enters consecutive values, i.e. if there's a value in day 10 then days 1-9 must include values as well.

Is there a way to use Data Validation to provide a pop-up warning message if the user enters a value into a given column but hasn't in any of the prior cells in the same row? Or perhaps easier, a check along the lines of:
Code:
IF the cell to the current cell is empty THEN give a warning

Want this to be a warning only i.e. the user can still continue entering values, even if they're not in consecutive columns for the same row

If this doesn't make sense, I'll attach a screenshot if possible.

Thanks,
Jack
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Maybe you can adapt something like this worksheet change event. This assumes that your header row is row 1 and begins in A1 - change to suit.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim R As Range
If Not Intersect(Target, [A1].CurrentRegion) Is Nothing Then
    Set R = Target.Cells(1, 1)
    If R.Row = 1 Then Exit Sub
    If WorksheetFunction.CountA(Cells(R.Row, "A").Cells(R.Row, R.Column - 1)) < R.Column - 1 Then
        MsgBox "All cells in row " & R.Row & " must be filled in up to " & R.Address
    End If
End If
End Sub
 
Upvote 0
Thank you, can see how that would work, will adapt that but will wait to see if any other suggestions are given. Thanks JoeMo
 
Upvote 0

Forum statistics

Threads
1,207,197
Messages
6,077,013
Members
446,250
Latest member
Dontcomehereoften

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