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
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
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" <[email protected]> wrote in
message news:[email protected]...
>
> 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
>
<my code >
What code?
--
Kind regards,
Niek Otten
"tkemo569" <[email protected]> wrote in
message news:[email protected]...
>
> 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
>
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks