20201224 2312
00 Intro
One of the most frequenty action when using Excel, is copy & paste, clear contents and add sheets.
(it looks like that the above sentence is wrong)
a="test"
worksheets(a).usedrange.clearcontents
worksheets(a).usedrange.copy
worksheets(a).range("a1").pastespecial xlpastevalues
worksheets(a).range("a1").pastespecial xlpasteformats
01 codes written on bloomberg pc
Sub zSaveBackupFile()
zPath = [c2]
zName = ActiveSheet.Name
zNow = Format(Now, "yyyymmdd HHMM")
zFile = zName & "_" & zNow
[c1] = zNow
Range([a1], [a1].SpecialCells(xlLastCell)).Select
Selection.Copy
Workbooks.Add
Selection.PasteSpecial Paste:=xlPasteValues, _
Operation:=xlNone, _
SkipBlanks:=False, _
Transpose:=False
Application.CutCopyMode = False
ActiveWorkbook.SaveAs Filename:=zPath & zFile, _
FileFormat:=xlOpenXMLWorkbook, _
CreateBackup:=False
ActiveWindow.Close
Sheets(zName).Select
End Sub
'[PA] 업무자동화 > [XL]Excel & VBA' 카테고리의 다른 글
XL pivot, parallel labels(나란히 보기), measure(측정값), concatenateX, % bp (0) | 2021.02.01 |
---|---|
XL 연결된 셀로 이동, 수식 분석 Trace (0) | 2021.01.14 |
XL number format, 천단위 백만단위로 숫자 표시하기,placeholder, thousand separator, decimal point placeholder (0) | 2020.12.24 |
XL remove links (0) | 2020.12.24 |
XL Pivot Table Calculated Fields (0) | 2020.11.06 |