Excel精英培训网

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

[已解决]求助加上一句代码

[复制链接]
发表于 2012-5-9 12:23 | 显示全部楼层 |阅读模式
If Target.Address = "$S$2" Then Cells(Rows.Count, 22).End(xlUp).Offset(1, 0).Value = "01"
把上面的代码在后面加上Range("X1").Select
最佳答案
2012-5-9 12:26
If Target.Address = "$S$2" Then Cells(Rows.Count, 22).End(xlUp).Offset(1, 0).Value = "01": Range("X1").Select


或者

If Target.Address = "$S$2" Then
    Cells(Rows.Count, 22).End(xlUp).Offset(1, 0).Value = "01"
    Range("X1").Select
End If
发表于 2012-5-9 12:25 | 显示全部楼层

  1.     If Target.Address = "$S$2" Then
  2.         Cells(Rows.Count, 22).End(xlUp).Offset(1, 0).Value = "01"
  3.         Range("X1").Select
  4.     End If
复制代码

评分

参与人数 1 +3 收起 理由
清华 + 3 很给力!

查看全部评分

回复

使用道具 举报

发表于 2012-5-9 12:26 | 显示全部楼层    本楼为最佳答案   
If Target.Address = "$S$2" Then Cells(Rows.Count, 22).End(xlUp).Offset(1, 0).Value = "01": Range("X1").Select


或者

If Target.Address = "$S$2" Then
    Cells(Rows.Count, 22).End(xlUp).Offset(1, 0).Value = "01"
    Range("X1").Select
End If

评分

参与人数 1 +3 收起 理由
清华 + 3 很给力!

查看全部评分

回复

使用道具 举报

 楼主| 发表于 2012-5-9 12:30 | 显示全部楼层
那么的帅 发表于 2012-5-9 12:25

If Target.Address = "$S$2" Then Cells(Rows.Count, 22).End(xlUp).Offset(1, 0).Value = "01"Range("X1").Select 我在后面加?
回复

使用道具 举报

发表于 2012-5-9 12:31 | 显示全部楼层
清华 发表于 2012-5-9 12:30
If Target.Address = "$S$2" Then Cells(Rows.Count, 22).End(xlUp).Offset(1, 0).Value = "01"Range("X1 ...

两句写在同一行,要用:隔开.
回复

使用道具 举报

 楼主| 发表于 2012-5-9 12:42 | 显示全部楼层
Zipall 发表于 2012-5-9 12:31
两句写在同一行,要用:隔开.

终于明白了,ok ok
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-21 13:49 , Processed in 0.288379 second(s), 13 queries , Gzip On, Yac On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

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