![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Apr 2002
Location: Australia
Posts: 52
|
G'day,
Can anyone field this question for me? i want to know how to keep colour filled cells fixed in place. So, if u wanted to "sort" your spreadsheet, the filled cells would not move, only the data would move. Thanx guys! |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Monterrey, Mexico
Posts: 1,433
|
Try the following macros:
Code:
Public addresses(1000), colors(1000) Sub SaveColors() Dim i As Integer For Each Cell In ActiveSheet.UsedRange addresses(i) = Cell.Address colors(i) = Cell.Interior.ColorIndex i = i + 1 Next End Sub Sub UpdateColors() ActiveSheet.UsedRange.ClearFormats For i = 0 To 1000 On Error GoTo 1 Range(addresses(i)).Interior.ColorIndex = colors(i) Next 1 End Sub
__________________
Kind regards, Al Chara |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Apr 2002
Location: Australia
Posts: 52
|
Thanks Al, much appreciated!
|
|
|
|
|
|
#4 |
|
Board Regular
Join Date: Apr 2002
Location: Kissimmee, Florida
Posts: 384
|
Hi KnAsTa,
You can do this using conditional formatting. If you want columns A-G in row 4 to be a blue background Select the cells in A-G in row 4. Format Conditional Formatting In the 1st Drop Down change from Cell Value is to Formula is In the next box enter: =row()=row() Next click the format box choose the patterns tab and select the colour of your choice. Click OK Click OK This can now be sorted and will not move. This formatting can be copied and since the condition is always true will show the colour of your choice. |
|
|
|
|
|
#5 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Millbank, London, UK
Posts: 1,790
|
Good one s-o-s, I like this
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|