여러 파일 이름 한꺼번에 바꾸기
작성자 정보
- 모아 작성
- 작성일
컨텐츠 정보
- 6 조회
- 0 추천
- 0 비추천
- 목록
본문
여러 파일 이름 한꺼번에 바꾸기
책제목:챗GPT+엑셀업무자동화정석
Sub RenameFiles()
Dim MyFile As String
Dim NewName As String
Dim MyPath As String
Dim MyExtension As String
Dim FSO As Object
Dim MyObj As Object
Dim TodayDate As String
' Set the folder path to the "실적" folder on the desktop.
MyPath = Environ$("USERPROFILE") & "\Desktop\실적\"
' Create a file system object.
Set FSO = CreateObject("Scripting.FileSystemObject")
' Get the current date in the format of YYYYMMDD.
TodayDate = Format(Date, "yyyymmdd")
' Loop through each file in the folder.
For Each MyObj In FSO.GetFolder(MyPath).Files
' Get the file extension.
MyExtension = FSO.GetExtensionName(MyObj)
' Rename the file.
MyFile = Left(MyObj.Name, Len(MyObj.Name) - Len(MyExtension) - 1)
NewName = MyFile & "_" & TodayDate & "." & MyExtension
Name MyPath & MyObj.Name As MyPath & NewName
Next MyObj
End Sub
[출처] 엑셀매크로(VBA) - 예제 모음|작성자 천칭
|
포인트 선물 선물명단 선물하기
최소 5P ~ 최대 100000000P 까지 가능합니다.
로그인 후 선물하실 수 있습니다.
선물 받은 내용이 없습니다.
관련자료

-
등록일 05:56
-
등록일 05:56
-
등록일 05:56
-
등록일 05:55