View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
jhahes[_52_] jhahes[_52_] is offline
external usenet poster
 
Posts: 1
Default Loop inside a Loop


I am novice in vba so I will try to explain what I need and show yo
what I have.

I have about 200 rows in Column A of Sheet 1 (all number format, al
unique)

I want to have the code select the first number in the column (A2)

Then

Go to sheet 15 Column A to see if the number is there. If it isn'
there then put it in the next available row in Column A.

I want this to loop through all the 200 rows in Column A of Sheet 1 an
do the same thing.

Here is what I have so far, I know it is probably very tedious. M
problem is I don't know how to store the first activecell to referenc
to:

If Sheet1.Visible = xlSheetHidden Then
Sheet1.Visible = xlSheetVisible
End If
Sheet1.Activate
Range("A2").Select
If ActiveCell.Offset(0, 5).Value < "" Then
If Sheet15.Visible = xlSheetHidden Then
Sheet15.Visible = xlSheetVisible
End If
Sheet15.Activate
Range("A2").Select
Do
If ActiveCell.Value < FirstActiveCell.Value Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until ActiveCell.Value = FirstActiveCell.Value O
ActiveCell.Row = 1000
If ActiveCell.Row = 1000 Then
Range("A2").Select
Do
If IsEmpty(activcell) = False Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True
ActiveCell.Value = FirstActiveCell.Valu

--
jhahe
-----------------------------------------------------------------------
jhahes's Profile: http://www.excelforum.com/member.php...fo&userid=2359
View this thread: http://www.excelforum.com/showthread.php?threadid=53058