Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
In the following block of code, a variable is compared to the active cell, and then either of two macros run, and it loops. Not matter what happens, though, only the macro "CreateHomeRun" runs. "CreateJumper" never runs. Any ideas? Thanks, Joe Dim CellAbove As Range Set CellAbove = ActiveCell.Offset(-1, 0) Do Until ActiveCell = "" If ActiveCell = CellAbove Then CreateJumper Else: CreateHomeRun End If Loop |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Joe,
Your code fails beacuse the comparitor is an unchanging active cell. Try something like: '=========== Sub Tester001() Dim rng As Range Dim rCell As Range Set rng = Range(ActiveCell, ActiveCell.End(xlDown)) For Each rCell In rng.Cells With rCell If IsEmpty(.Value) Then Exit Sub If .Value = .Offset(-1).Value Then CreateJumper Else CreateHomeRun End If End With Next rCell End Sub '<<=========== --- Regards, Norman "Joe Fish" wrote in message ups.com... Hi, In the following block of code, a variable is compared to the active cell, and then either of two macros run, and it loops. Not matter what happens, though, only the macro "CreateHomeRun" runs. "CreateJumper" never runs. Any ideas? Thanks, Joe Dim CellAbove As Range Set CellAbove = ActiveCell.Offset(-1, 0) Do Until ActiveCell = "" If ActiveCell = CellAbove Then CreateJumper Else: CreateHomeRun End If Loop |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Norman,
It works like a charm. Thanks, Joe |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Calculate working days but change working week | Excel Discussion (Misc queries) | |||
Making weekend days working days - the system cuts the working tim | Excel Discussion (Misc queries) | |||
macro was working, now it's not working | Excel Programming | |||
Macro working in Excel 2003; not working in Excel 2000 | Excel Programming | |||
Adding sales from a non working day to the previous working day | Excel Programming |