根据约束着色单元格(Coloring cell according to constraints)
是否可以使用一些简单的约束着色单元格(对于这些我假设列没有字母而是数字):
Statring单元格(x0,y0)和结束单元格(x1,y1) 细胞必须满足等式(x,2x)例如,我选择单元格begin(1,1)和end(10,10)着色应该发生在(1,1)(2,3)(3,5)(4,7)(5,9),那就是它因为(6,11)将超出y。
如果有可能你能告诉我它是如何做到的?
Is it possible to coloring cells using some simple constraints (for these I assume columns don't have letters but numbers):
Statring cell (x0, y0) and ending cell (x1, y1) Cells must fulfill equation (x, 2x)For instance I select cell begin (1,1) and end (10, 10) Coloring should happens to (1,1) (2,3) (3,5) (4,7) (5,9) and that's it since (6,11) would go out of bound for y.
If it's possible could you tell me how it can be done?
最满意答案
非常简单的宏将完成此任务:
Dim i As Integer For i = 1 To 100 'Instead of 100, put your upper number here. With Cells(i, i * 2).Interior .Pattern = xlSolid .PatternColorIndex = xlAutomatic .ThemeColor = xlThemeColorLight2 .TintAndShade = -0.249977111117893 .PatternTintAndShade = 0 End With NextVery simple macro will accomplish this:
Dim i As Integer For i = 1 To 100 'Instead of 100, put your upper number here. With Cells(i, i * 2).Interior .Pattern = xlSolid .PatternColorIndex = xlAutomatic .ThemeColor = xlThemeColorLight2 .TintAndShade = -0.249977111117893 .PatternTintAndShade = 0 End With Next更多推荐
发布评论