标签:spl end lse sheet class false delete saveas splay
Sub ss() Dim biao As Worksheet Excel.Application.DisplayAlerts = False For Each biao In Sheets If biao.Name <> "绝不能删" Then biao.Delete End If Next Excel.Application.DisplayAlerts = True End Sub
Sub xinjian() Dim sht As Worksheet For Each sht In Sheets sht.Copy ActiveWorkbook.SaveAs Filename:="d:\data\" & sht.Name & "" ActiveWorkbook.Close Next End Sub
Sub test() Dim i As Integer Dim sht As Worksheet For Each sht In Worksheets sht.Select For i = 100 To 2 Step -1 ‘处理性别的代码 If Range("e" & i) = "男" Then Range("f" & i) = "先生" Else Range("f" & i) = "女士" End If ‘处理专业代号 If Range("b" & i) = "理工" Then Range("c" & i) = "LG" ElseIf Range("b" & i) = "文科" Then Range("c" & i) = "WK" Else Range("c" & i) = "CJ" End If ‘删除空行 If Range("d" & i) = "" Then Range("D" & i).Select Selection.EntireRow.Delete End If Next ‘拆分表 sht.Copy ActiveWorkbook.SaveAs Filename:="d:\data\" & sht.Name & ".xlsx" ActiveWorkbook.Close Next End Sub
标签:spl end lse sheet class false delete saveas splay
原文地址:https://www.cnblogs.com/yigeduanpian/p/10041727.html