Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
use time functions inside if loop | Excel Worksheet Functions | |||
Create an array inside a For...Next loop | Excel Programming | |||
Advancing outer Loop Based on criteria of inner loop | Excel Programming | |||
Problem adding charts using Do-Loop Until loop | Excel Programming | |||
declaring active cell inside a for loop and offsetting from it | Excel Programming |