Thread: help with loops
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Rick B[_6_] Rick B[_6_] is offline
external usenet poster
 
Posts: 12
Default help with loops

This works excellent...thank you very much......I do have one slight problem
however, if instead of the range A1:A..nth as I stated in the
problem.....how would this be written if the range in both worksheets is
C50:C70.

I am having a hard time following your logic.

Thank you

-rick

"tolgag " wrote in message
...
Hi,

I hope this works...

P.S. : not tested


Sub copyRange()

Dim v As Variant
Dim i As Integer
Dim intRow As Integer

intRow = 1
Do
intRow = intRow + 1
Loop Until Sheets(1).Cells(intRow, 1) = ""

v = Sheets(2).Range("a1:a100")

For i = LBound(v) To UBound(v)

If Not IsNull(v(i, 1)) Then
Sheets(1).Cells(intRow, 1) = v(i, 1)
intRow = intRow + 1
End If

Next


End Sub


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