Results 1 to 2 of 2

Thread: [RESOLVED] Filename no extension, left of first "_"

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2012
    Posts
    12

    Resolved [RESOLVED] Filename no extension, left of first "_"

    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!

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    25,464

    Re: Filename no extension, left of first "_"

    try asking in the Office Development forum:

    http://www.vbforums.com/forumdisplay...ce-Development

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width