From: Jack Sons on 3 Jun 2010 18:32
I did like you advised, and now it works like a charm. Marvelous, thank you.
"Project Mangler" <dblack(a)ntlworld.com> schreef in bericht
> Hi Jack,
> Apologies, dumb error on my part:
> I assume that your populated range begins in K1?
> If so change Set A = Cells(1, 11).End(xlDown)
> Set A = Range("K1")
> "Project Mangler" <dblack(a)ntlworld.com> wrote in message
>> Hi Jack,
>> "Jack Sons" <sonsindenhaag(a)gmail.com> wrote in message
>> > PM,
>> > Thanks for the code. I tried it but it does nothing.
>> Well that is disappointing.
>> >As far as my abilities
>> > go I checked the working of the code. I saw that it starts wit setting
>> > A
>> > B both to equal the content of the last cell in column K.
>> I'm not clear why
>> Set A = Cells(1, 11).End(xlDown)
>> would ever find the last cell in an occupied column unless that column
>> had one populated cell. If that is what is happening then the rest of the
>> code will never work.
>> You could substitute the line above with
>> Set A = Range("K1").End(xlDown)
>> but really it shouldn't make any difference.
>> > I think the code misses something.
>> All I can tell you is that it works here in excel 2003. I don't post
>> untested code but perhaps I misread your original post.
>> My test sheet is populated from A3 to AV22 with a mix of numbers and text
>> alternate columns (1 - 22) for numbers, (a - t) for text with one number
>> letter per cell in ascending order down the column.
>> K8 - K13 have blue font (colorindex 5), all others are black font.
>> The code correctly identifies the start and end of the occupied range in
>> column K and sorts A8 - AV13 in descending order. The biggest flaw in the
>> code that I have identified is that it will only sort the first range of
>> coloured cells encountered should there be more than one block of them.
>> > For your information: in the case that I checked the first 9 cells (1
>> > and 8 data) are all with black font (font code 1). Then follow 13 cells
>> > font code 5 and after that 3 cells with again black font.
>> I assume that this is in Column K as indicated in your original post.
>> > Please be so kind as to make the necessary changes in the code (I can't
>> > figure them out) and - if it is not to time consuming - please explain
>> > the code works. A thousand thanks in advance.
>> I suggest that you try a repost in microsoft.public.excel.programming.
>> are much more capable coders in there than me. Perhaps one of them will
>> correct my attempt.
>> Good luck!
First | Prev |
Pages: 1 2
Prev: Custom color scheme
Next: Can insert digital ink into Excel cell or a cell comment?