Jul 12 2021 11:58 AM
I have a Macro (ExcelFileName) in the attached file that creates a new name for the file based on the highlighted cells in the screenshot below. The naming convention that we use is as follows:
Rule Code_Short Description_Dollar Amount_Cent Amount_Initials.xlsm
This is what I would like to be produced for the attached entry: YRA_ReclassRev_400_00_KAW.xlsm
This is what is currently being produced by the macro: YRA_ReclassRev_400_KAW.xlsm
Unfortunately, I am not able to get the Macro to include the “_00” when there is a round number such as $400.00. The Macro works in cases where we don’t have a round number such as $400.87. Here is the part of the Macro that creates the file name based on the various cell values with Cell K13 being the $400.00 in this example.
strName = Replace(Range("k15") & "_" & Range("k5") & "_" & Range("k13") & "_" & Range("k4"), " ", "")
strName = Replace(strName, ".", "_")
Any suggestions would be greatly appreciated.
Jul 12 2021 12:18 PM
SolutionUse
strName = Replace(Range("k15") & "_" & Range("k5") & "_" & Format(Range("k13"), "0.00") & "_" & Range("k4"), " ", "")
strName = Replace(strName, ".", "_")
Jul 12 2021 12:18 PM
SolutionUse
strName = Replace(Range("k15") & "_" & Range("k5") & "_" & Format(Range("k13"), "0.00") & "_" & Range("k4"), " ", "")
strName = Replace(strName, ".", "_")