I am trying to return a portion of a filename.
This is what I have written:
ActiveCell.FormulaR1C1 = ActiveWorkbook.name & " " & Format(Now(), "mm/yyyy")
My filenames come through like this:
MacroTest_DoNotUse_OrOpen.xlsx 01/2013
I want to only return "MacroTest". The desired result will only return the portion of the filename to the left of the first "_" reading left to right. I can write this in Excel, but having trouble in VBA. If anyone has a solution I appreciate it!
This is what I have written:
ActiveCell.FormulaR1C1 = ActiveWorkbook.name & " " & Format(Now(), "mm/yyyy")
My filenames come through like this:
MacroTest_DoNotUse_OrOpen.xlsx 01/2013
I want to only return "MacroTest". The desired result will only return the portion of the filename to the left of the first "_" reading left to right. I can write this in Excel, but having trouble in VBA. If anyone has a solution I appreciate it!