[ start | index | login ]
start > Excel

Excel

Created by mpecher. Last edited by mpecher, one year and 173 days ago. Viewed 1,172 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
Please login to post a comment.

Menu:
Java & J2EE
Development
Books

Help:
Help FAQ
Formatting


< May 2012 >
SunMonTueWedThuFriSat
12345
6789101112
13141516171819
20212223242526
2728293031


Logged in Users: (0)
… and a Guest.



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.