+ Reply to Thread
Results 1 to 2 of 2

Monthly string in filepath

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    02-24-2010
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003
    Posts
    195

    Monthly string in filepath

    Im useing the below date string code to insert dates into set filepaths.
    Im just looking for a piece of code that will take the middle 2 charactors (eg. 07-05-10 middle two = 05) and change the month in the below filepath accordingly.

    Drive\Folder\Folder\Breakdowns\2010\05_May\" & strDate & "\filename " & strDate & ".xls

    Any help would be apreciated, cheers.

    Sub DateField()
    
    If TextBox1.Value = "" Then
    MsgBox ("Enter This Weeks Date")
    NoDate = True
    Exit Sub
    Else
    NoDate = False
    ThisWeekDate = TextBox1.Value
    End If
    
    End Sub
    
    
    Sub AssignPathsToVariables(strDate As String)
    
    Dim filepaths(100) As Variant
    
    Drive\Folder\Folder\Breakdowns\2010\05_May\" & strDate & "\filename " & strDate & ".xls
    
    End Sub

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,933

    Re: Monthly string in filepath

    Check out the MID function.
    Ben Van Johnson

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1