Class Modules - referring to workbook properties
Hi Bob
I posted a question yesterday but haven't had any takers, and now it's
becomng urgent (it's the last problem to vercome before I go live).
I have the following line in a macro:
F_REF.Range("Y54:AE72").Sort Key1:=F_REF.Range("AE54"), Order1:=xlAscending,
Key2:=F_REF.Range("AB54"), Order2:=xlAscending, _
Header:=xlNo, OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom, DataOption1:=xlSortNormal,
DataOption2:=xlSortNormal
Most often when this line is run automatically, it doesn't sort, but there
are times when it does (rare). If I step through the code then the sort works
EVERY time. Similarly, if I execute the macro manually by clicking a text
box, it works every time.
I've tried it with calc Auto/Manual and it makes no difference whatsoever.
I am at a complete loss with this. I cannot understand how it can work
manually but not as part of a macro that runs it automatically.
I am working with the same test data set in every instance (i.e. when it
works and when it doesn't). Do you have any idea what could be causing this,
and if not how I could work around it please?
I've tried putting just the sort line into a separate macro, and that worked
for a little while, but now that too fails to work ( I thought I had it
licked with a work-around but not to be). Regards, Brett
|