ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Find (https://www.excelbanter.com/excel-programming/348024-find.html)

tkemo569[_2_]

Find
 

I can't seem to get my code to work. All i need to do is determine if a
cell has a Name in it or if it is blank. Could i get some help please.

Thanks


--
tkemo569
------------------------------------------------------------------------
tkemo569's Profile: http://www.excelforum.com/member.php...o&userid=29573
View this thread: http://www.excelforum.com/showthread...hreadid=493150


Norman Jones

Find
 
Hi T,

Perhaps this will help:

'=============
Public Sub Tester()
Const sAdd As String = "A1" '<<==== CHANGE
Const sName As String = "Test" '<<==== CHANGE

If IsEmpty(Range(sAdd)) Then
MsgBox "The cell " & sAdd & " is blank"
ElseIf Range(sAdd) = sName Then
MsgBox "The cell " & sAdd & "text = " & sName
ElseIf InStr(1, Range(sAdd), sName, vbTextCompare) Then
MsgBox "The cells " & sAdd _
& " text includes " & sName
Else
MsgBox "The contents " & sAdd & " = " _
& Range(sAdd).Value
End If
End Sub
'<<=============

--
---
Regards,
Norman



"tkemo569" wrote in
message ...

I can't seem to get my code to work. All i need to do is determine if a
cell has a Name in it or if it is blank. Could i get some help please.

Thanks


--
tkemo569
------------------------------------------------------------------------
tkemo569's Profile:
http://www.excelforum.com/member.php...o&userid=29573
View this thread: http://www.excelforum.com/showthread...hreadid=493150




Niek Otten

Find
 
<my code

What code?

--
Kind regards,

Niek Otten

"tkemo569" wrote in
message ...

I can't seem to get my code to work. All i need to do is determine if a
cell has a Name in it or if it is blank. Could i get some help please.

Thanks


--
tkemo569
------------------------------------------------------------------------
tkemo569's Profile:
http://www.excelforum.com/member.php...o&userid=29573
View this thread: http://www.excelforum.com/showthread...hreadid=493150





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

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