Office中国论坛/Access中国论坛

标题: 修改宏按下增加顏色(問題以解決) [打印本页]

作者: joyark    时间: 2007-1-12 08:50
标题: 修改宏按下增加顏色(問題以解決)
修改宏按下增加顏色



請幫忙解決

希望修改宏

按一次底顏色是白色,再按一次更換底顏色是黃色,再按一次更換底顏色是紫色

Sub copy()
Range("A2").Value = "=IF(RC[1]="""","""",MAX(R[-1]C:R[-1]C)+1)"
Range("A2:M2").copy Range("A65536").End(xlUp).Offset(1)
     Range("A2:M2").Select
    Selection.ClearContents
End Sub

[此贴子已经被作者于2007-1-13 14:06:32编辑过]


作者: joyark    时间: 2007-1-13 22:05
問題以解決

謝謝

Sub mCopy()
    Range("A2").Value = "=IF(RC[1]="""","""",MAX(R[-1]C:R[-1]C)+1)"
    Range("a2:m2").copy Range("a65536").End(xlUp).Offset(1)
    Range("b2:l2").ClearContents
    mTimes = mTimes Mod 3 + 1
    Range("b2:l2").Interior.ColorIndex = Choose(mTimes, "2", "27", "26")
End Sub
Sub copy1()
Range("A2").Value = "=IF(RC[1]="""","""",MAX(R[-1]C:R[-1]C)+1)"
Range("A2:M2").copy Range("A65536").End(xlUp).Offset(1)
     Range("A2:M2").Select
    Selection.ClearContents
If Cells.Interior.ColorIndex = 26 Then
Cells.Interior.ColorIndex = 2
ElseIf Cells.Interior.ColorIndex = 2 Then
Cells.Interior.ColorIndex = 27
ElseIf Cells.Interior.ColorIndex = 27 Then
Cells.Interior.ColorIndex = 26
End If
End Sub





欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/) Powered by Discuz! X3.3