Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Not Looping | Excel Discussion (Misc queries) | |||
Looping | Excel Discussion (Misc queries) | |||
Looping...but why? | Excel Programming | |||
Looping | Excel Programming | |||
Looping | Excel Programming |