Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default 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



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
basic question M121385 New Users to Excel 4 May 6th 08 06:22 PM
Basic question...sorry jen the runner Excel Worksheet Functions 11 September 18th 07 12:12 AM
Visual Basic code to find next available (blank) row in a spreadsh TB Excel Programming 2 July 15th 05 08:01 PM
Too Basic A Question dave Excel Programming 6 October 26th 03 03:57 PM
Basic VBA question Henrik[_2_] Excel Programming 2 October 25th 03 12:23 AM


All times are GMT +1. The time now is 04:29 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"