Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
J@Y J@Y is offline
external usenet poster
 
Posts: 127
Default Test if there is data in a cell or not?

What function can be used to test if there is data in a cell or not?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default Test if there is data in a cell or not?

Paste this into a worksheet module and click around

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If ActiveCell.Value = "" Then
MsgBox "No data here"
Else
MsgBox "Cell contains " & Cells(1, 1).Value

End If
End Sub

Mike

"J@Y" wrote:

What function can be used to test if there is data in a cell or not?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default Test if there is data in a cell or not?

=IF(A1<"","Data in celll.","No Data in cell")

"J@Y" wrote:

What function can be used to test if there is data in a cell or not?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Test if there is data in a cell or not?

Maybe...

=if(a1="","it looks empty","something's there")

But if A1 contained a formula like:
=if(b2=7,"0k,"")
and evaluated to "", then it would look empty.



J@Y wrote:

What function can be used to test if there is data in a cell or not?


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Test if there is data in a cell or not?

And in code, you can check to see if the cell is empty--no value and no formula:

if isempty(activesheet.range("a1").value) then
'it's empty
else
'it's got a value or formula
end if



J@Y wrote:

What function can be used to test if there is data in a cell or not?


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.programming
J@Y J@Y is offline
external usenet poster
 
Posts: 127
Default Test if there is data in a cell or not?

Thank you guys!
  #7   Report Post  
Posted to microsoft.public.excel.programming
J@Y J@Y is offline
external usenet poster
 
Posts: 127
Default Test if there is data in a cell or not?

Thank you guys!
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
How to do LSD test in data analyses MD Excel Discussion (Misc queries) 1 March 17th 10 07:24 AM
Multiple choice test data - How do I get Excel to deal with one row of data? [email protected] Excel Discussion (Misc queries) 2 September 30th 07 07:45 PM
VB syntax to test for data validation in a cell Dave O Excel Discussion (Misc queries) 2 July 26th 07 09:29 PM
Calculate mean of test scores from rows of test answers RiotLoadTime Excel Discussion (Misc queries) 1 July 26th 06 05:14 PM
How can i test a cell for bold style in a cell (Excel 2003)? Mike A. Excel Worksheet Functions 2 March 6th 06 07:23 PM


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