Looping

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
Sub rows()
Dim lRows As Long
lRows = ActiveCell.End(xlDown).Row - ActiveCell.Row + 1
MsgBox (lRows)
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top