删除一系列单元格的底部边框 [英] Removing bottom borders for a range of cells

查看:84
本文介绍了删除一系列单元格的底部边框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个非常简单的问题,希望有一个非常简单的解决方案.我正在尝试创建一个宏,以仅删除一系列单元格的底部边框.但是,如果我做类似的事情

I have a very simply problem which hopefully has a very simple solution. I am trying to create a macro to remove only the bottom borders of a range of cells. However, if I do something like

Range("D21:I28").Borders(xlEdgeBottom).Linestyle = xlNone

它仅删除单元格最低行的底部边框.有没有办法为每个单元格做到这一点?我不想使用for循环,因为它的速度很慢,并且您可以看到每个单元格的边框都被抹掉了-我想使其瞬时显示.

It only removes the bottom border of the lowest row of cells. Is there a way to do this for each cell? I do not want to use a for loop because it's slow and you can see each individual cell's borders getting erased - I want to make it instantaneous.

推荐答案

重新考虑您的决定并使用循环:

Reconsider your decision and use a loop:

Sub UseALoop()
    Application.ScreenUpdating = False
    For Each r In Range("D21:I28")
        r.Borders(xlEdgeBottom).LineStyle = xlNone
    Next r
    Application.ScreenUpdating = True
End Sub

这篇关于删除一系列单元格的底部边框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆