View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Help with Address property in nested loops

Chip,

Would you please include the text of the message to which you are
responding in your posts. It makes things much easier to follow.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Chip" wrote in message
ups.com...
It was a little tricky to figure it out since I didnt know the
ranges
of some of your range variables, but here is what I found.
When this
loop gets going:

Do While ActiveCell.Value = ""
Application.ActiveCell.Offset(rowoffset:=1,
columnoffset:=0).Select
Loop

It wont stop to check if it has reached the 500th row...so here
is what
I did:

'goes to starting cell
Application.Goto
reference:=Worksheets("newdata").Range("newlist")


Do Until ActiveCell.Row = 500


'finds the first cell that contains data
If ActiveCell.Value = "" Then
Application.ActiveCell.Offset(rowoffset:=1,
columnoffset:=0).Select
Else


contents = ActiveCell.Value
Location = ActiveCell.Address


'goes to destination location
Application.Goto reference:=Worksheets("Comments
Results").Range("Q5list")


'finds the first blank cell in column
Do Until ActiveCell.Value = ""
Application.ActiveCell.Offset(rowoffset:=1,
columnoffset:=0).Select
Loop


'inserts the value and returns to last location to begin again
ActiveCell.Value = contents
Application.Goto
reference:=Worksheets("newdata").Range(Location)
Application.ActiveCell.Offset(rowoffset:=1,
columnoffset:=0).Select

End If
Loop


I changed it to an If, then statement so that the outer loop is
run
each time that check is done. See if that works, and if not
let me
know...