Dear Sir,
Kindly provide me a macro code for the below mentioned scenario
I have a excel file in the following path
D:\TEST\1121_10.10.2023_RAGHU.xlsx
I want to open the file as
D:\TEST\1121_RAGHU.xlsx
Regards
Dear Sir,
Kindly provide me a macro code for the below mentioned scenario
I have a excel file in the following path
D:\TEST\1121_10.10.2023_RAGHU.xlsx
I want to open the file as
D:\TEST\1121_RAGHU.xlsx
Regards
You cannot open a file with a different name than the file actually has.
Do you mean that you want to save a copy of the file, using a different name?
Do you mean that you want to change the name of the file then open it with the new name?
I want to change the name of the file as 1121_raghu.xlsx and then open the file
The _10.10.2023 should be removed. If it 11.10.2023 then _11.10.2023 to be removed and the file to be opened
According to your explanation a VBA demonstration for starters :
PHP Code:
Sub Demo1()
Const P = "D:\TEST\", Bill = P & "1121_RAGHU.xlsx"
F$ = Dir$(P & "1121_??.??.????_RAGHU.xlsx")
If F > "" Then
If Dir(Bill) > "" Then Kill Bill
Name P & F As Bill
Workbooks.Open Bill, 0
End If
End Sub
► Do you like it ? ► ► So thanks to click on bottom left star icon « ★ Add Reputation » ! ◄ ◄
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks