Microsoft Office Tutorials and References
In Depth Information
Tables: Copying Formulas
View the Appendix to learn how to store this procedure
in a UserForm.
Option explicit¶
' * * * * *¶
Private Sub btnAddToList_Click()¶
If Me.txtFieldCode.SelLength > 1 Then¶
lstFormulas.AddItem Me.txtFieldCode.SelText¶
End If¶
End Sub¶
' * * * * *¶
Private Sub btnCancel_Click()¶
Me.Hide¶
DoUnload¶
End Sub¶
' * * * * *¶
Private Sub btnCopy_Click()¶
Me.Hide¶
CopyFormula¶
End Sub¶
Wrd
Follow these steps:
1. Copy the first section of code to a module in a template or in
Normal.dot. The second section of code goes in a UserForm. Transfer
the UserForm, frmCopyFormula, to the same project either by using the
Organizer or by dragging the UserForm in the Visual Basic Editor
(VBE) to the template's project.
2. In the text box at the top of the dialog box, select the part of the formula
that should be modified. Click the "Add to list" button. Note that text
can be selected in the text box, but cannot be edited.
The tool checks for the presence of the entire formula that is added to
the list; for example, (A2 * A3). Only those parts of the formula that
exactly match will be changed. Any other parts of the formula
containing these cell references will not be changed unless they are also
added to the list.
3. Repeat the above step for every separate part of the formula that should
be modified. Click on the document. Select the cells to which the
formula should be copied. Click the button "COPY FORMULA".
Search JabSto ::




Custom Search