Excel精英培训网

 找回密码
 注册
数据透视表40+个常用小技巧,让你一次学会!
查看: 1754|回复: 3

[已解决]代码修改!!求助

[复制链接]
发表于 2011-7-19 17:57 | 显示全部楼层 |阅读模式
Sub 颜色()
Dim i As Long, j As Long, k As Long
Dim mycell As Range
Dim arr As Long
Set mycell = Application.InputBox(prompt:="选取单元格范围", Type:=8)
i = mycell.Cells.Count
j = mycell.Column
k = mycell.Row
Cells(j, k).Interior.Color = 15
End Sub
我想将选取区域的第一个单元格填充成红色,总不成功,请求帮助!!!
最佳答案
2011-7-19 18:43
本帖最后由 gdgzlyh 于 2011-7-20 02:23 编辑

最后一句改为
cells(k,j).interior.color=vbred
excel精英培训的微信平台,每天都会发送excel学习教程和资料。扫一扫明天就可以收到新教程
发表于 2011-7-19 18:43 | 显示全部楼层    本楼为最佳答案   
本帖最后由 gdgzlyh 于 2011-7-20 02:23 编辑

最后一句改为
cells(k,j).interior.color=vbred

评分

参与人数 1 +5 收起 理由
ls + 5

查看全部评分

回复

使用道具 举报

发表于 2011-7-19 20:17 | 显示全部楼层
gdgzlyh 发表于 2011-7-19 18:43
最后一句还为
cells(k,j).interior.color=vbred

试验成功,不错
回复

使用道具 举报

 楼主| 发表于 2011-7-21 10:38 | 显示全部楼层
谢谢!!!!!!!!1
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|Excel精英培训 ( 豫ICP备11015029号 )

GMT+8, 2024-5-10 11:23 , Processed in 0.240912 second(s), 12 queries , Gzip On, Yac On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

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