ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Basic question for blank column (https://www.excelbanter.com/excel-programming/346876-basic-question-blank-column.html)

Tre_cool[_18_]

Basic question for blank column
 

Hi, I can't seem to think of a line for this. I want to check a column
to see if it's blank or not in code. I know that in the worksheet
function I can do =COUNTA(W:W)=0, but what's the vb code for it?

Thanks
Trevor


--
Tre_cool
------------------------------------------------------------------------
Tre_cool's Profile: http://www.excelforum.com/member.php...o&userid=26416
View this thread: http://www.excelforum.com/showthread...hreadid=489185


[email protected]

Basic question for blank column
 
If range.IsEmpty(ActiveCell) then
do stuff
end

IsBlank is also an excel function

For info on how to declare a range in VB poke around...
http://msdn.microsoft.com/library/de...angeobject.asp
or
http://msdn.microsoft.com/library/de...heetranges.asp


Tre_cool[_19_]

Basic question for blank column
 

I can't get this to work. I just want to check if column W is empty or
not. Please help.


--
Tre_cool
------------------------------------------------------------------------
Tre_cool's Profile: http://www.excelforum.com/member.php...o&userid=26416
View this thread: http://www.excelforum.com/showthread...hreadid=489185


Norman Jones

Basic question for blank column
 
Hi Tre_cool,

Try:

If Application.CountA(Columns("W")) = 0 Then

---
Regards,
Norman


"Tre_cool" wrote in
message ...

I can't get this to work. I just want to check if column W is empty or
not. Please help.


--
Tre_cool
------------------------------------------------------------------------
Tre_cool's Profile:
http://www.excelforum.com/member.php...o&userid=26416
View this thread: http://www.excelforum.com/showthread...hreadid=489185




Tre_cool[_20_]

Basic question for blank column
 

THanks Norman..That worked!

Trevor


--
Tre_cool
------------------------------------------------------------------------
Tre_cool's Profile: http://www.excelforum.com/member.php...o&userid=26416
View this thread: http://www.excelforum.com/showthread...hreadid=489185



All times are GMT +1. The time now is 07:10 AM.

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