Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Require Cell Entry based on condition

I am working on enhancing our expense report to require the users to enter a
code in a specified cell if the dollar value of certain cells is greater than
zero.

Column E contains the code that will be required if any expense amounts are
entered in columns L thru Q of that same row. I would like to validate each
row before proceeding to entering the next row. This validation needs to
be run on 20 rows.

Any suggestions would be greatly appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.programming
GB GB is offline
external usenet poster
 
Posts: 230
Default Require Cell Entry based on condition

Hmm.. I don't think this will be your final answer, however I could conceive
that you use one of the default functions on the sheet that deals with
changes in cells. If the data in a cell changes to a value that does not
meet your validation criteria, you store the row of the change. Then if the
user tries to select a different row to be active, the user is alerted and
the activecell becomes a predesignated column in the row that is a problem.
The user should be informed how to get around this if they need to select a
different cell for data review.

Not the program to do it, but it's the idea you are looking for, I think.


"Kathy - Lovullo" wrote:

I am working on enhancing our expense report to require the users to enter a
code in a specified cell if the dollar value of certain cells is greater than
zero.

Column E contains the code that will be required if any expense amounts are
entered in columns L thru Q of that same row. I would like to validate each
row before proceeding to entering the next row. This validation needs to
be run on 20 rows.

Any suggestions would be greatly appreciated.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Require Cell Entry based on condition

In theory this would work, but I guess I am looking for a little more
instruction on some of the code to do this.

What functions could I use for the validation? How do I validate that the
sum of Column L thorugh Q is not greater than zero using VBA Code. My
thoughts are that if it is greater I would return a Msgbox informing them
they need to enter a code in column E of that row and return them to that
cell.

Can anyone provide me with some help or tips on the proper functions and VBA
coding to use?

Thanks


"GB" wrote:

Hmm.. I don't think this will be your final answer, however I could conceive
that you use one of the default functions on the sheet that deals with
changes in cells. If the data in a cell changes to a value that does not
meet your validation criteria, you store the row of the change. Then if the
user tries to select a different row to be active, the user is alerted and
the activecell becomes a predesignated column in the row that is a problem.
The user should be informed how to get around this if they need to select a
different cell for data review.

Not the program to do it, but it's the idea you are looking for, I think.


"Kathy - Lovullo" wrote:

I am working on enhancing our expense report to require the users to enter a
code in a specified cell if the dollar value of certain cells is greater than
zero.

Column E contains the code that will be required if any expense amounts are
entered in columns L thru Q of that same row. I would like to validate each
row before proceeding to entering the next row. This validation needs to
be run on 20 rows.

Any suggestions would be greatly appreciated.

  #4   Report Post  
Posted to microsoft.public.excel.programming
GB GB is offline
external usenet poster
 
Posts: 230
Default Require Cell Entry based on condition

I wrote a dirty version of what you are looking for, because I can not access
VBA helpfiles right now. The message box that is created, also shows the
total of the sum. Thought I would include it so that you could chose not to
include it if you wish. But the following code would be added to the code of
the worksheet in which you want to do validation.



Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
Dim Sum As Double

Sum = 0

Sum = Sheet1.Cells(Target.Row, "L").Value
Sum = Sum + Sheet1.Cells(Target.Row, "M").Value
Sum = Sum + Sheet1.Cells(Target.Row, "N").Value
Sum = Sum + Sheet1.Cells(Target.Row, "O").Value
Sum = Sum + Sheet1.Cells(Target.Row, "P").Value
Sum = Sum + Sheet1.Cells(Target.Row, "Q").Value

If Sum <= 0 Then
MsgBox ("The sum of the values between Columns L and Q is Less than
or equal to zero. (" & Sum & ") Either revise the numbers to total greater
than zero or Enter the appropriate data in Column E")
Sheet1.Cells(Target.Row, "E").Select
End If
End Sub

"Kathy - Lovullo" wrote:

In theory this would work, but I guess I am looking for a little more
instruction on some of the code to do this.

What functions could I use for the validation? How do I validate that the
sum of Column L thorugh Q is not greater than zero using VBA Code. My
thoughts are that if it is greater I would return a Msgbox informing them
they need to enter a code in column E of that row and return them to that
cell.

Can anyone provide me with some help or tips on the proper functions and VBA
coding to use?

Thanks


"GB" wrote:

Hmm.. I don't think this will be your final answer, however I could conceive
that you use one of the default functions on the sheet that deals with
changes in cells. If the data in a cell changes to a value that does not
meet your validation criteria, you store the row of the change. Then if the
user tries to select a different row to be active, the user is alerted and
the activecell becomes a predesignated column in the row that is a problem.
The user should be informed how to get around this if they need to select a
different cell for data review.

Not the program to do it, but it's the idea you are looking for, I think.


"Kathy - Lovullo" wrote:

I am working on enhancing our expense report to require the users to enter a
code in a specified cell if the dollar value of certain cells is greater than
zero.

Column E contains the code that will be required if any expense amounts are
entered in columns L thru Q of that same row. I would like to validate each
row before proceeding to entering the next row. This validation needs to
be run on 20 rows.

Any suggestions would be greatly appreciated.

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
Require an entry in a cell Erika Excel Discussion (Misc queries) 3 September 25th 09 09:15 PM
How do I require data entry in a cell before moving to the next ce CindyB Excel Worksheet Functions 3 April 26th 08 04:18 PM
Require specific cell entry before saving file Patrick Riley Excel Discussion (Misc queries) 2 March 20th 08 03:50 PM
How to require entry in a cell or group of cells? Jim Thomlinson[_3_] Excel Programming 0 February 3rd 05 06:51 PM
Require cell entry Bernie Deitrick Excel Programming 0 June 24th 04 02:43 PM


All times are GMT +1. The time now is 10:57 AM.

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"