Excel精英培训网

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

[已解决]不规择区域怎么加边框

[复制链接]
发表于 2011-8-16 12:53 | 显示全部楼层 |阅读模式
1、比如说:A8:k65536这个区域中有时候只有两行、有时候会有10,总之这个行数不定,那么如果出现两行时我要把这两行的边框加上,同样,出现几行就自动把这几行加上边框。
2、set rg = sheets("g").range("A:A").find(cells(X,1)
     IF not rg is nothing then cells(X,Y)=rg.offset(0,y-1)
如果我的G 这张表是放在共享盘里,\\192.168.40.223\Medical\3id\6pd\新建文件夹\bok1.xls  应该怎么加?


最佳答案
2011-8-16 13:31
Sub t()
    Set rng = Range("A8:K" & Range("A65536").End(xlUp).Row)
    rng.Borders(xlEdgeLeft).LineStyle = xlContinuous
    rng.Borders(xlEdgeTop).LineStyle = xlContinuous
    rng.Borders(xlEdgeBottom).LineStyle = xlContinuous
    rng.Borders(xlEdgeRight).LineStyle = xlContinuous
    rng.Borders(xlInsideVertical).LineStyle = xlContinuous
    rng.Borders(xlInsideHorizontal).LineStyle = xlContinuous
End Sub
发表于 2011-8-16 13:31 | 显示全部楼层    本楼为最佳答案   
Sub t()
    Set rng = Range("A8:K" & Range("A65536").End(xlUp).Row)
    rng.Borders(xlEdgeLeft).LineStyle = xlContinuous
    rng.Borders(xlEdgeTop).LineStyle = xlContinuous
    rng.Borders(xlEdgeBottom).LineStyle = xlContinuous
    rng.Borders(xlEdgeRight).LineStyle = xlContinuous
    rng.Borders(xlInsideVertical).LineStyle = xlContinuous
    rng.Borders(xlInsideHorizontal).LineStyle = xlContinuous
End Sub
回复

使用道具 举报

 楼主| 发表于 2011-8-16 15:16 | 显示全部楼层
谢谢了                              
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-25 13:10 , Processed in 0.211549 second(s), 4 queries , Gzip On, Yac On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

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