ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   IS THERE ANYONE WHO CAN SOLVE MY PROBLEM ..(JOEL , MIKE H , RON ,PETER , BOB) ANYONE.... (https://www.excelbanter.com/excel-programming/430309-there-anyone-who-can-solve-my-problem-joel-mike-h-ron-peter-bob-anyone.html)

K[_2_]

IS THERE ANYONE WHO CAN SOLVE MY PROBLEM ..(JOEL , MIKE H , RON ,PETER , BOB) ANYONE....
 
Hi all, I have code below which save the current worksheet in
folder "Record" with the name "Rec"

Private Sub CommandButton1_Click()
Me.Select
Me.Copy
ActiveWorkbook.SaveAs Filename:="C:\Documents\Record\Rec.xlsm",
FileFormat:= _
xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
ActiveWindow.Close
End Sub


I want to give name "Rec" to all my files in same folder but I want
macro to put 1 , 2 , 3… etc at the end of every file name. How can I
change above macro that it should first check the folder "Record" if
there is any file with the name "Rec" and if there is then it should
put 1 at the end of the file and save it.


All times are GMT +1. The time now is 10:03 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com