Results 1 to 8 of 8

Extract data from filename and auto-set static date

Threaded View

  1. #2
    Forum Contributor
    Join Date
    08-11-2009
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    149

    Re: Extract data from filename and auto-set static date

    For cell F6, either =CELL("filename") or if you don't want the directory and sheet names then =MID(CELL("filename"),FIND("[",CELL("filename"))+1,FIND("]",CELL("filename"))-1-FIND("[",CELL("filename")))

    As for your H10 date, you need a macro that runs when the workbook is opened like:
    Private Sub Workbook_Open()
    If Range("H10") = "" Then
        Range("H10").Select
        ActiveCell.FormulaR1C1 = "=TODAY()"
        Selection.Copy
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        Application.CutCopyMode = False
    End If
    End Sub
    (Note: this requires the template be blank in that cell, or you could fill it w/ something like "DATE" and then change the if statement in the macro from "" to "DATE" or whatever)

    Oh and there might be a simpler way to past the date into the cell, I admit that I'm not much of a macro person myself.
    Last edited by masteff; 05-12-2010 at 06:11 PM.

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