Friday, September 14, 2012

Adding Months To A Date In Excel

=IF(DAY(DateReference) > DAY(DATE(YEAR(DateReference),MONTH(DateReference)+MonthsToAdd+1,1)-1),DATE(YEAR(DateReference),MONTH(DateReference)+MonthsToAdd+1,1)-1,DATE(YEAR(DateReference),MONTH(DateReference)+MonthsToAdd,DAY(DateReference)))

Friday, April 27, 2012

For Visio diagam complaining when trying to edit the text on a shape:
"This UML shape exists on a drawing page which is not part of a UML model diagram. This shape is designed to work in drawings"

I was able to strip out the UML double-click call it didn't like for all the shapes.

Public Sub kirks_fix_for_UML_Shape_error ()

    Dim o As Visio.Shape
    For Each o In Application.ActivePage.Shapes
        Debug.Print o.Name
        If o.CellsSRC(visSectionObject, visRowEvent, visEvtCellDblClick).FormulaU = "RUNADDONWARGS(""UML Background Add-on"",""/CMD=1001"")" Then
            o.CellsSRC(visSectionObject, visRowEvent, visEvtCellDblClick).FormulaU = "=DEFAULTEVENT()"
        End If
    Next o    MsgBox "done"
End Sub