You can migrate rows dependent on the color of the column and the color depends on "conditional formatting"
You can migrate rows dependent on the color of the column and the color depends on "conditional formatting"
Determining color of CF in code is always tricky. It's better to evaluate the CF-formula in your code and based on that migrate your data.
https://www.youtube.com/channel/UCnxwq2aGJRbjOo_MO54oaHA
https://eileenslounge.com/viewtopic.php?p=244184#p244184
https://eileenslounge.com/viewtopic.php?p=246586#p246586
https://eileenslounge.com/viewtopic.php?p=246112#p246112
https://eileenslounge.com/viewtopic.php?p=246112#p246112
https://eileenslounge.com/viewtopic.php?p=245761#p245761
https://eileenslounge.com/viewtopic.php?p=245722#p245722
https://eileenslounge.com/viewtopic.php?p=245616#p245616
https://eileenslounge.com/viewtopic.php?p=247043#p247043
https://www.excelfox.com/forum/showthread.php/2307-VBA-Range-Sort-with-arrays-Alternative-for-simple-use
https://eileenslounge.com/viewtopic.php?p=245238#p245238
https://eileenslounge.com/viewtopic.php?p=245131#p245131
https://eileenslounge.com/viewtopic.php?f=18&t=31638
https://eileenslounge.com/viewtopic.php?p=244579#p244579
https://eileenslounge.com/viewtopic.php?p=244648#p244648
https://eileenslounge.com/viewtopic.php?p=244647#p244647
https://eileenslounge.com/viewtopic.php?p=244577#p244577
https://eileenslounge.com/viewtopic.php?p=245201#p245201
https://eileenslounge.com/viewtopic.php?p=243975#p243975
https://eileenslounge.com/viewtopic.php?p=243884#p243884
https://eileenslounge.com/viewtopic.php?p=242439#p242439
https://eileenslounge.com/viewtopic.php?p=243595#p243595
https://eileenslounge.com/viewtopic.php?p=243589#p243589
https://eileenslounge.com/viewtopic.php?p=243589#p243589
https://eileenslounge.com/viewtopic.php?p=243002#p243002
https://www.eileenslounge.com/viewtopic.php?p=242761#p242761
https://eileenslounge.com/viewtopic.php?p=242459#p242459
https://eileenslounge.com/viewtopic.php?p=242054#p242054
https://eileenslounge.com/viewtopic.php?p=241404#p241404
https://eileenslounge.com/viewtopic.php?p=229145#p229145
https://eileenslounge.com/viewtopic.php?p=228710#p228710
https://eileenslounge.com/viewtopic.php?p=226938#p226938
https://eileenslounge.com/viewtopic.php?f=18&t=28885
https://eileenslounge.com/viewtopic.php?p=222689#p222689
https://eileenslounge.com/viewtopic.php?p=221622#p221622
https://eileenslounge.com/viewtopic.php?f=27&t=22512
https://eileenslounge.com/viewtopic.php?f=26&t=26183
https://eileenslounge.com/viewtopic.php?f=26&t=26030
https://eileenslounge.com/viewtopic.php?p=202322#p202322
https://www.excelforum.com/word-formatting-and-general/1174522-finding-a-particular-word-phrase-in-word.html#post4604396
https://www.youtube.com/channel/UCnxwq2aGJRbjOo_MO54oaHA
Last edited by DocAElstein; 04-16-2024 at 06:41 PM.
This file contains an example of conditional formatting
The above code copies the result to Sheet2Code:Sub tst() For Each cl In Sheets("Sheet1").Columns(1).SpecialCells(2) Sheets("Sheet2").Range("B" & Rows.Count).End(xlUp).Offset(1).Resize(, 5) = cl.Offset(, 1).Resize(, 5).Value Next End Sub
Are you looking to do this with a macro?
Confirm you have Excel 2003 and no higher.
Is the colour of the conditional format always because of a single formula (or can several different formulae lead to the same colour)?
Give me an error code
" RUN-TIME ERROR "1004 "
Yes looking for code migrates table by "conditional formatting"
I use Office 2003
In your example file from Post#4 this works just fine for me so something must be different in your original file.
I'd guess emmye998 either has no constants in column A, or formulae.
So the file probably isn't representative of what he has.
I didn't get an answer to one of my questions:
Is the colour of the conditional format always because of a single formula (or can several different formulae lead to the same colour)?
So we need a representative file.
Conditional formatting in Excel 2003 is more basic and there isn't a cell's .DisplayFormat.Interior.Color until Excel 2010.
So finding whether a cell's conditional format is returning a given color to the cell can be complex in Excel 2003.
Normally, in code, I'd autofilter the range on a column or columns, copy and paste to another location, then remove the filter. However if may be more complex than that with emmye998's file since there may be more than one conditional format formula returning the same colour, hence my question. It may be easier to add helper column(s), hidden if you want, filter on them and then copy/paste.
Bookmarks