设为首页收藏本站Access中国

Office中国论坛/Access中国论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

返回列表 发新帖
查看: 1609|回复: 1
打印 上一主题 下一主题

[基础应用] 修改宏按下增加顏色(問題以解決)

[复制链接]
跳转到指定楼层
1#
发表于 2007-1-12 08:50:00 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
修改宏按下增加顏色



請幫忙解決

希望修改宏

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

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编辑过]

分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享分享 分享淘帖 订阅订阅
2#
 楼主| 发表于 2007-1-13 22:05:00 | 只看该作者
問題以解決

謝謝

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
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|站长邮箱|小黑屋|手机版|Office中国/Access中国 ( 粤ICP备10043721号-1 )  

GMT+8, 2025-2-23 21:49 , Processed in 0.092183 second(s), 25 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表