Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Copying formats?

I am using a Conditional Formula:

=(ROW(C4)/2=INT(ROW(C4)/2))

to shade each second row. Because I need to move the rows around, I need
them to "remember" their shade colours which were issued to them via the CF
above.

Is there a Copy, PasteSpecial SolidFormatsOnly type of command? I just
want to replace the cells who have shading activated by the CF above to
permanently keep the shading no matter where they are moved to.

XL2003

--
|
+-- Julian
|


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Copying formats?


I think it would be a lot easier to get rid of the formatconditions
and make a sub to do the alternate shading
Sub Shade()
Dim r
With ActiveSheet.UsedRange
.Interior.ColorIndex = xlNone
For Each r In .Rows
If r.Row Mod 2 = 1 Then r.Interior.ColorIndex = 36
Next
End With
End Sub



--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Thief_ wrote :

I am using a Conditional Formula:

=(ROW(C4)/2=INT(ROW(C4)/2))

to shade each second row. Because I need to move the rows around, I
need them to "remember" their shade colours which were issued to them
via the CF above.

Is there a Copy, PasteSpecial SolidFormatsOnly type of command? I
just want to replace the cells who have shading activated by the CF
above to permanently keep the shading no matter where they are moved
to.

XL2003

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Copying formats?

i forgot:

you'll need a handler for your sheet to keep your shading,
following will work on row insert/delete or typing beyond usedrange.
but will not trigger on an edit/ cut or paste inside.

Private Sub Worksheet_Change(ByVal Target As Range)
Static sAddr$
If Me.UsedRange.Address < sAddr Then
Shade
sAddr = Me.UsedRange.Address
End If

End Sub




--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


keepITcool wrote :


I think it would be a lot easier to get rid of the formatconditions
and make a sub to do the alternate shading
Sub Shade()
Dim r
With ActiveSheet.UsedRange
.Interior.ColorIndex = xlNone
For Each r In .Rows
If r.Row Mod 2 = 1 Then r.Interior.ColorIndex = 36
Next
End With
End Sub



--
keepITcool
www.XLsupport.com | keepITcool chello nl | amsterdam



Thief_ wrote :

I am using a Conditional Formula:

=(ROW(C4)/2=INT(ROW(C4)/2))

to shade each second row. Because I need to move the rows around, I
need them to "remember" their shade colours which were issued to
them via the CF above.

Is there a Copy, PasteSpecial SolidFormatsOnly type of command?
I just want to replace the cells who have shading activated by the
CF above to permanently keep the shading no matter where they are
moved to.

XL2003

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Copying formats?

If he moved a shaded row to a position not normally shaded by the shade
routine, how would you see the handler/shade routine (as you have presented
it) preserving the shading? I think you would need a different type of
shade routine for dynamic updating after you ran the first one to replace
the shading performed by the conditional formatting. I would suggest
something like the below although it assumes column A would not be
disturbed.

Private Sub Worksheet_Change(ByVal Target As Range)
Static sAddr$
If Me.UsedRange.Address < sAddr Then
Shade1
sAddr = Me.UsedRange.Address
End If

End Sub

Sub Shade1()
Dim r As Range
Dim i As Long
With ActiveSheet.UsedRange
For Each r In .Rows
i = r.Cells(1, 1).Interior.ColorIndex
r.EntireRow.Interior.ColorIndex = xlNone
r.Interior.ColorIndex = i
Next
End With
End Sub

--
Regards,
Tom Ogilvy



"keepITcool" wrote in message
ft.com...
i forgot:

you'll need a handler for your sheet to keep your shading,
following will work on row insert/delete or typing beyond usedrange.
but will not trigger on an edit/ cut or paste inside.

Private Sub Worksheet_Change(ByVal Target As Range)
Static sAddr$
If Me.UsedRange.Address < sAddr Then
Shade
sAddr = Me.UsedRange.Address
End If

End Sub




--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


keepITcool wrote :


I think it would be a lot easier to get rid of the formatconditions
and make a sub to do the alternate shading
Sub Shade()
Dim r
With ActiveSheet.UsedRange
.Interior.ColorIndex = xlNone
For Each r In .Rows
If r.Row Mod 2 = 1 Then r.Interior.ColorIndex = 36
Next
End With
End Sub



--
keepITcool
www.XLsupport.com | keepITcool chello nl | amsterdam



Thief_ wrote :

I am using a Conditional Formula:

=(ROW(C4)/2=INT(ROW(C4)/2))

to shade each second row. Because I need to move the rows around, I
need them to "remember" their shade colours which were issued to
them via the CF above.

Is there a Copy, PasteSpecial SolidFormatsOnly type of command?
I just want to replace the cells who have shading activated by the
CF above to permanently keep the shading no matter where they are
moved to.

XL2003



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copying formats - column widths, formats, outlining to worksheets DavidBr318 Excel Worksheet Functions 4 August 14th 09 05:03 AM
Copying printer formats ramona Excel Discussion (Misc queries) 3 August 7th 09 03:45 PM
copying conditon formats with $ Mark Excel Worksheet Functions 12 February 10th 09 12:40 AM
Copying Formats JoeSpareBedroom Excel Discussion (Misc queries) 9 February 7th 07 06:33 PM
Copying Cell Formats Mark Schreiber Excel Programming 2 December 20th 04 10:53 PM


All times are GMT +1. The time now is 10:32 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"