Excel VBA search for value of a cell

L

Larry D

I am working on some vba code in Excel 2000 with Microsoft Windows
2000.

I want to select the first cell in a tab and see if it has a value in
it.

I would like the code to look something like this:

sheets("firsttab").select
range("a1").select
set currentcell=activecell

if current cell <> "" then
msgbox "There is data in the first tab", vbok
end if

Any idea what I am doing wrong?
 
J

JMay

Assuming you have a Sub header and Footer

The only problem I see is the SPACE you currently have
between "current cell" in your If line.

HTH
 
A

Alan

If Sheets("FirstTab").Range("A1") <> "" Then
MsgBox "There is data in the first tab", vbOK
End If

Regards,

Alan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top