[ start | index | login ]
start > Excel

Excel

Created by mpecher. Last edited by mpecher, one year and 59 days ago. Viewed 1,153 times. #3
[diff] [history] [edit] [rdf]
labels
attachments

Accessing the Last modified Date in a cell

Ok Excel's normal functions don't have this. But its easier to create your own (at little googling and some changes (good to see 4 years of VB weren't wasted):

Public Function ModDate()
ModDate = "Last updated: " + Format(FileDateTime(ThisWorkbook.FullName), "ddd dd mmm yyyy at HH:nn ")
End Function

Cut and paste this into the Modules in the VB Editor (Tools > Marcos > Visual Basic Editor). Save this and Select Close and REturn to Excel.

Now you have a user defined funtion you can use within your cells just like all the other functions (its even listed in the drop down). Its part of that workbook.

Merge two selection of cells into first

'**************************************************************************
    'Purpose:   Merge cells, retaining all data
    'Inputs:    Selection
    'Returns:   Merged values in the first cell of rRng
    '**************************************************************************
        Public Sub MergeToOneCell()
        'J.E. McGimpsey, >>http://www.mcgimpsey.com/excel/mergedata.html
        Const sDELIM As String = vbLf
        Dim rCell As Range
        Dim sMergeStr As String
        With Selection
            For Each rCell In .Cells
                sMergeStr = sMergeStr & sDELIM & rCell.Text
            Next rCell
            Application.DisplayAlerts = False
            .Merge Across:=False
            Application.DisplayAlerts = True
            .Item(1).Value = Mid(sMergeStr, 1 + Len(sDELIM))
        End With
    End Sub
no comments | post comment

Menu:
Java & J2EE
Development
Books

Help:
Help FAQ
Formatting


< February 2012 >
SunMonTueWedThuFriSat
1234
567891011
12131415161718
19202122232425
26272829


Logged in Users: (0)
… and 10 Guests.



Disclaimer: Views and opinions are that of the individual author, and not that of Marand Custom Solutions. This site is an open forum for technical content, and the company accepts no liability for any content or view expressed.