Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Do while empty colomn

Guys

Is there a way to to run a macro until it encounters a colomn with n
information in any cell?

Thanks for hel

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Do while empty colomn

One way

Sub rununtil()
i = 1
Do Until Application.CountA(Columns(i)) = 0
MsgBox Cells(1, i)
i = i + 1
Loop
End Sub
--
Don Guillett
SalesAid Software

"axg275 " wrote in message
...
Guys

Is there a way to to run a macro until it encounters a colomn with no
information in any cell?

Thanks for help


---
Message posted from
http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Do while empty colomn

Dim col As Range
Dim cCount
Dim i As Long

Do
i = i + 1
cCount = WorksheetFunction.CountA(Columns(i))
If cCount 0 Then
'do your stuff
End If
Loop Until cCount = 0

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"axg275 " wrote in message
...
Guys

Is there a way to to run a macro until it encounters a colomn with no
information in any cell?

Thanks for help


---
Message posted from http://www.ExcelForum.com/



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
how to search within a row or colomn for a particular string Glenda701 Excel Worksheet Functions 1 October 28th 09 09:09 PM
Label colomn with the headers myshak Excel Worksheet Functions 3 December 30th 08 10:30 PM
adding cells in a colomn mjd23 New Users to Excel 2 January 7th 08 11:45 PM
colomn to row Robert helou Excel Discussion (Misc queries) 1 August 10th 06 02:57 PM
sum of colomn.. Zadig Galbaras Excel Discussion (Misc queries) 2 February 7th 05 07:15 PM


All times are GMT +1. The time now is 08:05 AM.

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

About Us

"It's about Microsoft Excel"