[英]Copy Selection Interior ColorIndex to same area on different Worksheet
I'm trying to copy the Colorindex of a highlighted selection to a different Worksheet.我正在尝试将突出显示的选择的颜色索引复制到不同的工作表。
I have 4 different Worksheets and on sheet 1 the user is able to colorize the Cells.我有 4 个不同的工作表,在工作表 1 上,用户可以为单元格着色。 Then I want him to be able to select an area of those cells an copy the colors to all other sheets (same location) by clicking a button that triggers my sub "Mark_all".
然后我希望他能够通过单击触发我的子“Mark_all”的按钮将 select 区域复制到所有其他工作表(相同位置)。
I'm stuck because "selection" seems to contain the Worksheet on which the selection has been made.我被卡住了,因为“选择”似乎包含进行选择的工作表。
Here is what I tried:这是我尝试过的:
Dim CurCell As Range
Dim ColCurCell As Integer
Dim cWs As Worksheet
Sub Mark_all()
For Each CurCell In Selection
ColCurCell = CurCell.Interior.ColorIndex
For Each cWs In Application.ActiveWorkbook.Worksheets
If cWs.Name <> "A Worksheet I DonT want to be changed" Then
CurCell.Interior.ColorIndex = ColCurCell '<-- Here I dont know how to combine my CurCell with the other Worksheets
End If
Next
Next
End Sub
Thank you:-)谢谢:-)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.