|
修改了一下,关于新保存表的设置是和电脑相关的。
- Sub TZ20180716()
- Set wb1 = ThisWorkbook
- Set ws = wb1.Sheets("3新清单")
- Adr = wb1.Path
- sName = Right(Sheet1.Cells(4, 3).Value, 6)
- Set wb2 = Workbooks.Add
- ws.Copy after:=wb2.Sheets(1)
- wb2.SaveAs Adr & "" & sName
- wb2.Sheets("3新清单").Select
- Columns("C:C").Select
- Selection.Copy
- Selection.PasteSpecial Paste:=xlPasteValues
- '删除行
- For m = Cells(65536, 3).End(xlUp).Row To 2 Step -1
- If Cells(m, 3) = 0 Then Rows(m).Delete
- Next m
- '删除表
- For Each sht In ActiveWorkbook.Worksheets
- If Not sht.Name = "3新清单" Then sht.Delete
- Next sht
- Application.CutCopyMode = False
- End Sub
复制代码 |
|