Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a worksheet that has rows 3 - 23 in input lines for the user. Not all
rows will be used. It depends on how many places the person has visited. When the person goes to save the file I want to check to see if certain columns have been filled in. If they have not then I want to open a message box telling them to fill them in before saving. My question is this. since not all rows will have entries I only want to test the rows that have something in any of the columns A - AF Is there a simple way to check this? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try this
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) msg = "You must fill in the sheet before saving" If Worksheets("sheet5").Range("A3:AF23").Text = "" Then MsgBox (msg) End If End Sub "Keith" wrote: I have a worksheet that has rows 3 - 23 in input lines for the user. Not all rows will be used. It depends on how many places the person has visited. When the person goes to save the file I want to check to see if certain columns have been filled in. If they have not then I want to open a message box telling them to fill them in before saving. My question is this. since not all rows will have entries I only want to test the rows that have something in any of the columns A - AF Is there a simple way to check this? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Mike,
Unfortunatly this won't work as some fields are required and others are a case of this option or this option so some cells are mandatory and others are not. "Mike" wrote: Try this Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) msg = "You must fill in the sheet before saving" If Worksheets("sheet5").Range("A3:AF23").Text = "" Then MsgBox (msg) End If End Sub "Keith" wrote: I have a worksheet that has rows 3 - 23 in input lines for the user. Not all rows will be used. It depends on how many places the person has visited. When the person goes to save the file I want to check to see if certain columns have been filled in. If they have not then I want to open a message box telling them to fill them in before saving. My question is this. since not all rows will have entries I only want to test the rows that have something in any of the columns A - AF Is there a simple way to check this? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
automate the colouring of lots of cells | Excel Discussion (Misc queries) | |||
Lots of Frustration - Lots of Arrays, Dynamic Ranges Don't Work, Help With Options | Excel Programming | |||
Lots of single clickable cells | Excel Programming |