Excel精英培训网

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

[已解决]求大神 帮帮忙

[复制链接]
发表于 2021-4-10 11:25 | 显示全部楼层 |阅读模式
怎么删除excel中所有大于某个字号的行 比如说删除表格中大于11号字体的行
最佳答案
2021-4-10 12:42
Sub gsgsre()
     r0 = ActiveSheet.UsedRange.Rows.Count
     c0 = ActiveSheet.UsedRange.Columns.Count
     r1 = ActiveSheet.UsedRange.Range("a1").Row
     c1 = ActiveSheet.UsedRange.Range("a1").Column
     For x = r0 + r1 - 1 To r1 Step -1
        For y = c1 To c1 + c0 - 1
        If Cells(x, y).Font.Size > 11 Then
        Rows(x).Delete
        Exit For
        End If
        Next
     Next
    End Sub
发表于 2021-4-10 12:42 | 显示全部楼层    本楼为最佳答案   
Sub gsgsre()
     r0 = ActiveSheet.UsedRange.Rows.Count
     c0 = ActiveSheet.UsedRange.Columns.Count
     r1 = ActiveSheet.UsedRange.Range("a1").Row
     c1 = ActiveSheet.UsedRange.Range("a1").Column
     For x = r0 + r1 - 1 To r1 Step -1
        For y = c1 To c1 + c0 - 1
        If Cells(x, y).Font.Size > 11 Then
        Rows(x).Delete
        Exit For
        End If
        Next
     Next
    End Sub
回复

使用道具 举报

 楼主| 发表于 2021-4-10 13:55 | 显示全部楼层
高 发表于 2021-4-10 12:42
Sub gsgsre()
     r0 = ActiveSheet.UsedRange.Rows.Count
     c0 = ActiveSheet.UsedRange.Columns.Co ...

感谢大佬,我再改改
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-4-20 02:29 , Processed in 0.830456 second(s), 9 queries , Gzip On, Yac On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

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