ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Checking cells contain a value (https://www.excelbanter.com/excel-programming/384703-checking-cells-contain-value.html)

ingalla

Checking cells contain a value
 
I need to check that when i leave cell 7 in each row that either cell 6 or 7
contain a value. If they neither cell contain any values i want to display a
warning message.

How can I do this?

Andy

joel

Checking cells contain a value
 
give me more information. Not sure if you arre coding in VBA or working with
functions on an excel spreadsheet. In either case you need a macro.

If you are working in an excel spreadsheet then you need to writte a macro
call

Sum Worksheet_change(). If you arre already in VBA there are some test
functions you can use like isnull(cell) or isempty(cell).

"ingalla" wrote:

I need to check that when i leave cell 7 in each row that either cell 6 or 7
contain a value. If they neither cell contain any values i want to display a
warning message.

How can I do this?

Andy


ingalla

Checking cells contain a value
 
I am working with functions on the worksheet

"Joel" wrote:

give me more information. Not sure if you arre coding in VBA or working with
functions on an excel spreadsheet. In either case you need a macro.

If you are working in an excel spreadsheet then you need to writte a macro
call

Sum Worksheet_change(). If you arre already in VBA there are some test
functions you can use like isnull(cell) or isempty(cell).

"ingalla" wrote:

I need to check that when i leave cell 7 in each row that either cell 6 or 7
contain a value. If they neither cell contain any values i want to display a
warning message.

How can I do this?

Andy


joel

Checking cells contain a value
 
See if this is what you want. On the tab at the bottom of the worksheet
press right mouse button and select view code. Put this code into the VBA
editor. then go back to worksheet and see if it works properly




Private Sub Worksheet_change(ByVal Target As Range)


If (ActiveSheet.Cells(Target.Row, 6) = "") And _
(ActiveSheet.Cells(Target.Row, 7) = "") Then

MsgBox ("Warning: Columns F & G are both empty")
End If

End Sub


"Joel" wrote:

give me more information. Not sure if you arre coding in VBA or working with
functions on an excel spreadsheet. In either case you need a macro.

If you are working in an excel spreadsheet then you need to writte a macro
call

Sum Worksheet_change(). If you arre already in VBA there are some test
functions you can use like isnull(cell) or isempty(cell).

"ingalla" wrote:

I need to check that when i leave cell 7 in each row that either cell 6 or 7
contain a value. If they neither cell contain any values i want to display a
warning message.

How can I do this?

Andy


Dave Peterson

Checking cells contain a value
 
Have you thought about just using a formula in an adjacent cell:

Kind of like:

=if(counta(a2:g2)=0,"",if(counta(f2:g2)0,"","Put something in F or G"))

Use a nice big red bold format.



ingalla wrote:

I need to check that when i leave cell 7 in each row that either cell 6 or 7
contain a value. If they neither cell contain any values i want to display a
warning message.

How can I do this?

Andy


--

Dave Peterson


All times are GMT +1. The time now is 03:13 PM.

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