#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Looping

I am making a program that finds a cell and then checks the cells belonging
to same column. I am having trouble with the loop. I want to check the cells
and see if they are empty. If they are the loop is to be terminated and the
number of rows "belonging" to the loop shall be saved so that I know the
length of the list. However I do not know how to write the loop properly. I
am very thankful for any fast assistance. My code so far is:

Private Sub findValue2()
Dim rng As Range
Dim findVal As String
Dim i As Integer
Dim list As Integer
Set rng = Worksheets("Dimension").Cells.Find("qc", LookIn:=xlValues)
Worksheets("Indata").Range("K1") = rng.Address
rad = rng.Row
kolumn = rng.Column
i = 0
Do Until rng.Value < ""
Cells(rng.Row + i, rng.Column) = i
i = i + 1
list = list + 1



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 573
Default Looping

Sub rows()
Dim lRows As Long
lRows = ActiveCell.End(xlDown).Row - ActiveCell.Row + 1
MsgBox (lRows)
End Sub

anderssweden wrote:
I am making a program that finds a cell and then checks the cells belonging
to same column. I am having trouble with the loop. I want to check the cells
and see if they are empty. If they are the loop is to be terminated and the
number of rows "belonging" to the loop shall be saved so that I know the
length of the list. However I do not know how to write the loop properly. I
am very thankful for any fast assistance. My code so far is:

Private Sub findValue2()
Dim rng As Range
Dim findVal As String
Dim i As Integer
Dim list As Integer
Set rng = Worksheets("Dimension").Cells.Find("qc", LookIn:=xlValues)
Worksheets("Indata").Range("K1") = rng.Address
rad = rng.Row
kolumn = rng.Column
i = 0
Do Until rng.Value < ""
Cells(rng.Row + i, rng.Column) = i
i = i + 1
list = list + 1


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
Not Looping Roger Excel Discussion (Misc queries) 0 February 26th 08 05:18 PM
Looping David T Excel Discussion (Misc queries) 2 August 30th 06 10:51 PM
Looping...but why? cherrynich Excel Programming 2 May 12th 06 04:57 PM
Looping scottwilsonx[_54_] Excel Programming 0 October 5th 04 04:29 PM
Looping René Excel Programming 6 May 28th 04 02:14 PM


All times are GMT +1. The time now is 06:41 PM.

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"