newbie - If a cell is blank

S

Steve

Hello,
I am a newbie. Anyway, here we go...

The project I am working is to make my life easier at work. So you may get
a lot of questions on here from over the next few months!!!!

Anyway, I have a command button that is to be linked to another sheet, if
pressed it goes there .. that was easy! .. but now i need it to check that
a cell is not empty B4 it goes onto the other sheet, if it is empty it will
not goto the other sheet ... if you know what I mean.

Sheets1 has the button and a cell that needs to be filled. if filled then
it goes to Sheet2, if not then it stays on sheet1.


---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 080107-0, 07/01/2008
Tested on: 07/01/2008 21:32:33
avast! - copyright (c) 1988-2008 ALWIL Software.
http://www.avast.com
 
P

Per Jessen

Hello,
I am a newbie. Anyway, here we go...

The project I am working is to make my life easier at work. So you may get
a lot of questions on here from over the next few months!!!!

Anyway, I have a command button that is to be linked to another sheet, if
pressed it goes there .. that was easy! .. but now i need it to check that
a cell is not empty B4 it goes onto the other sheet, if it is empty it will
not goto the other sheet ... if you know what I mean.

Sheets1 has the button and a cell that needs to be filled. if filled then
it goes to Sheet2, if not then it stays on sheet1.

---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 080107-0, 07/01/2008
Tested on: 07/01/2008 21:32:33
avast! - copyright (c) 1988-2008 ALWIL Software.http://www.avast.com

Hi Steve

Something like this:

if sheets("Sheet1").range("B4").value <> "" then
sheets("Sheet2").select

Regards,

Per
 
J

John Bundy

Not tested but this should do what you want, just fill in row and column for
the row and column you are checking. btw in code you don't need to navigate
to the page to see if it is blank, just include the sheet name or number.
If Sheets(2).cells(row,col)="" then
exit sub
End if

'code for what to do if it is not blank
 

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

Similar Threads

reset a cell 5
How do you hide ..... 2
Auto insert 2
Locking Cells 1
Hidding buttons 3
Spin button 2
VBA time and date? 1
Merging 1

Top