Question : Formula for Quarter Dys, Excel

I need a formula which works out the next quarter day from the completion date inserted.
These are :  25/03, 24/06, 29/09 and 25/12.
So, if I inserted "26/08/10", it would populate 29/09/10 in the 'Next Quarter Day' cell.
Can anyone help?
Many thanks

Answer : Formula for Quarter Dys, Excel

In general, I advise using a Range object instead of the Selection object where possible. Also it is easier to see what you are are trying to do (and hence easier to maintain) if you specify where you want to be in terms of the objects, as opposed to MoveDown and MoveRight, etc.

However you can Select and search a single column.

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
Private Sub DocControlAdd()
   'Dim texta, textb, textc, textd, texte, textf As String 'this Dims all except the last variable as a variant

    Dim texta As String, textb As String, textc As String, textd As String, texte As String, textf As String
     Dim tbl As Table
    Dim rw As Row
    Dim cl As Cell
    Dim c As Integer
    Dim iStartCol As Integer
    
    texta = ActiveDocument.CustomDocumentProperties.Item("xRevisionNo")
    textb = ActiveDocument.CustomDocumentProperties.Item("xRevisionDate")
    textc = ActiveDocument.CustomDocumentProperties.Item("xDetails")
    textd = ActiveDocument.CustomDocumentProperties.Item("xPreparedby")
    texte = ActiveDocument.CustomDocumentProperties.Item("xReviewedby")
    textf = ActiveDocument.CustomDocumentProperties.Item("xApprovedby")
    iStartCol = 1
   Set tbl = ActiveDocument.Tables(1)

        If ActiveDocument.CustomDocumentProperties.Item("xNew") = "Y" Then
            Set rw = tbl.Rows.Add
        ElseIf NewVersion = True Then
            Set rw = tbl.Rows.Add
        ElseIf NewVersion = False Then
                tbl.Columns(iStartCol).Select
                With Selection.Find
                    .ClearFormatting
                    .MatchWholeWord = True
                    .MatchCase = True
                    If .Execute(FindText:=texta) Then
                        Set cl = Selection.Cells(1)
                        Set rw = tbl.Rows(cl.RowIndex)
                     End If
                End With
         End If
         c = iStartCol
         rw.Cells(c).Range.Text = texta
         c = c + 1
         rw.Cells(c).Range.Text = textb
         c = c + 1
         rw.Cells(c).Range.Text = textc
         c = c + 1
         rw.Cells(c).Range.Text = textd
         c = c + 1
         rw.Cells(c).Range.Text = texte
         c = c + 1
         rw.Cells(c).Range.Text = textf
    ActiveDocument.CustomDocumentProperties.Item("xRevisionNoOld").Value = ActiveDocument.CustomDocumentProperties.Item("xRevisionNo").Value

End Sub
Random Solutions  
 
programming4us programming4us