Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 262
Default Is there a simple way to check lots of cells for entries?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default Is there a simple way to check lots of cells for entries?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 262
Default Is there a simple way to check lots of cells for entries?

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
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
automate the colouring of lots of cells [email protected] Excel Discussion (Misc queries) 1 September 26th 06 10:42 AM
Lots of Frustration - Lots of Arrays, Dynamic Ranges Don't Work, Help With Options Karl Burrows Excel Programming 4 April 17th 04 12:48 PM
Lots of single clickable cells Ronald Moolenaar Excel Programming 3 August 13th 03 09:24 AM


All times are GMT +1. The time now is 03:47 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"