Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default 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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default 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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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
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
checking two different cells Stefan - AW Excel Worksheet Functions 1 September 7th 09 05:28 PM
Checking range of cells for entry then checking for total Barb Reinhardt Excel Programming 1 October 13th 06 02:47 PM
Checking the Cells in Sheet1 with Cells in Sheet2 and replace Checking the cells in Sheet1 with Sheet2 Excel Worksheet Functions 1 August 19th 06 09:29 AM
checking blank cells Arne Hegefors Excel Programming 1 July 31st 06 03:24 PM
copying cells by checking color of the cells JJJ010101 Excel Programming 1 January 24th 06 06:42 AM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"