Since you only originally posted 1 line of code and now one more, it would
be hard to say.
Perhaps the activecell doesn't contain a number or date when you have the
error.
--
Regards,
Tom Ogilvy
"excelnut1954" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Thanks for the responses. What I'm getting is a Type Mis Match error.
> What I was trying to do is to replace this line
> Do Until IsEmpty(ActiveCell.Value)
> with the one I have above. I inserted a line to sort the list by date,
> with the older records at the top. I was just trying to see if I could
> save a bit of time having it read only part of the list, instead of
> having to read all the 600 records.
>
> Anyway, the original works fine. So, I don't want to spend too much
> time on it.
> At this point, I'm more interested in why it didn't work, for future
> reference. I haven't yet put equations in any of my Do Until commands,
> so I thought I had the syntax wrong. Obviously there's something else
> at play on why the original line works ok in the macro, but not the new
> line.
> Thanks
> J.O.
> Tom Ogilvy wrote:
>> Sub ABC()
>> Range("A3").Select
>>
>> Do Until Range("Current_Date").Value - ActiveCell.Value < 361
>> ActiveCell.Offset(1, 0).Select
>> Loop
>> End Sub
>>
>> worked fine for me. It stopped on 10/25/2005
>>
>> --
>> Regards,
>> Tom Ogilvy
>>
>>
>>
>> "excelnut1954" wrote:
>>
>> > Can someone please tell me what is wrong with this command?
>> >
>> > Do Until Range("Current_Date").Value - ActiveCell.Value < 361
>> >
>> > I tried to add at the end,
>> >
>> > Do Until Range("Current_Date").Value - ActiveCell.Value < 361 = True
>> >
>> > but it still errors out.
>> >
>> > Any suggestions? I've browsed examples here, and couldn't find anything
>> > similar to what I'm doing.
>> > Thanks,
>> > J.O.
>> >
>> >
>
|