ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Manditory cells in table (https://www.excelbanter.com/excel-discussion-misc-queries/450488-manditory-cells-table.html)

Jeff Owen

Manditory cells in table
 
Hello All

Hopefully someone here can help and I am posting this in the right part of the forum.
I am looking to create a list of my employees name / department / start date / managers name. the issue is staff are leaving certain peices of information blank causing me to spend a lot of time searching through files to find the missing info. (I have tried explaining this to them but am at the head banging against a wall stage and need to make this idiot proof)
Is there a way that you could input one persons information on the list and if all the information isnt there it wont save? But also be able to add names further down the line as and when needed?

Thanks people!

Jeff

Gord Dibben[_2_]

Manditory cells in table
 
You will need code to prevent saving if cells are not filled.

Adapt to suit.

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, _
Cancel As Boolean)
Dim cell As Range
For Each cell In Sheets("Sheet1").Range("A2,A3")
If IsEmpty(cell.Value) Then
MsgBox "You must fill in cell " & cell.Address
Application.Goto cell
Cancel = True
Exit For
End If
Next cell
End Sub


Gord


On Fri, 5 Dec 2014 13:38:27 +0000, Jeff Owen
wrote:


Hello All

Hopefully someone here can help and I am posting this in the right part
of the forum.
I am looking to create a list of my employees name / department / start
date / managers name. the issue is staff are leaving certain peices of
information blank causing me to spend a lot of time searching through
files to find the missing info. (I have tried explaining this to them
but am at the head banging against a wall stage and need to make this
idiot proof)
Is there a way that you could input one persons information on the list
and if all the information isnt there it wont save? But also be able to
add names further down the line as and when needed?

Thanks people!

Jeff


Jeff Owen

Thanks for the reply. I have already tried something like this - the issue is I can but the values in for the first empty row (a1:a4) however when someone fills in the second name in row b they don't have to fill in everything as row a is already full.
If I put in rows a to g (for example) what happens of I only want to fill in one row. And then what happens when Someone fills in row h incorrectly.

Do you see my dilemma? I need something that says if column 1 is full on a particular row then columns 2,3,4 also need to be full

Gord Dibben[_2_]

Manditory cells in table
 
Your biggest dilemma is that you don't understand Excel's row and
column orientation.

Rows run across horizontally and are numbered 1 through whatever down
the left side.

Columns run vertically and are designated A to whatever across the
top.

You can modify the code to suit your needs once you decide what cells
need filling.

Gord

On Fri, 5 Dec 2014 17:58:25 +0000, Jeff Owen
wrote:


Thanks for the reply. I have already tried something like this - the
issue is I can but the values in for the first empty row (a1:a4) however
when someone fills in the second name in row b they don't have to fill
in everything as row a is already full.
If I put in rows a to g (for example) what happens of I only want to
fill in one row. And then what happens when Someone fills in row h
incorrectly.

Do you see my dilemma? I need something that says if column 1 is full on
a particular row then columns 2,3,4 also need to be full


Jeff Owen

Sorry. I have re worded my original comment.


I have already tried something like this - the
issue is I can but the values in for the first empty row (a1,b1,c1,d1) however
when someone fills in the second name in row 2 they don't have to fill
in everything as row 1 is already full.
If I put in rows 1-8 (for example) what happens of I only want to
fill in rows 1 and 2 . And then what happens when Someone fills in row 9
incorrectly.

Do you see my dilemma? I need something that says if column a is full on
a particular row then columns b,c,d also need to be full on the same row.


All times are GMT +1. The time now is 10:46 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com