![]() |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
![]()
Hello,
Firstly please let me advise that standard conditional formatting will not work here as this requires ten conditions to be set. I have a worksheet that contains 40 'paired' columns. In the first column of each pair I can enter any one of ten condition codes. The corresponding cell in the second of the paired columns needs to change its interior colour to that dictated by the code in the first of the pair. I have tried a few ways without success with my last attempt almost making it where I used three named ranges and this code: Code:
Dim conditions() ReDim conditions(1 To Range("conditions2use").Count) Dim i i = 1 For Each cell In Range("conditions2use") conditions(i) = CInt(cell.Value) i = i + 1 Next cell i = 1 For Each cell In Range("data2use") Range("formats2use").Cells(conditions(i)).Select Selection.Copy cell.Select Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _ SkipBlanks:=False, Transpose:=False i = i + 1 Next cell I hope someone in this forum has had a similar requirement in the past and can provide a solution. I am using MS Excel 2003 SR3. Thanks in anticipation |
Tags |
condition paste vba, formatting cells from vba |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
RoyLittle0 | Excel | 2 | 05-05-2013 12:50 AM |
![]() |
meileetan | Project | 3 | 09-12-2012 07:09 AM |
![]() |
Davidoff78 | Word VBA | 1 | 06-28-2012 05:23 PM |
CHange colour of footer if a cell changes to red | OTPM | Excel | 0 | 05-26-2011 07:15 AM |
contacts email by colour code | mikemans | Outlook | 0 | 10-31-2009 01:47 AM |