![]() |
|
|
|
#1
|
|||
|
|||
|
Code:
Function ScratchMacro()
'A basic Word Macro coded by Gregory K. Maxey
Dim strSearch As String
Dim iCount As Long, Hecho As Single
strSearch = "**"
iCount = 0
With ActiveDocument.Content.Find
.Text = strSearch
.Format = False
.Wrap = wdFindStop
Do While .Execute
iCount = iCount + 1
Loop
End With
Hecho = iCount / 2
'at end of document.
ActiveDocument.Range.InsertAfter vbCr & Hecho
'in a content control titled Hecho.
ActiveDocument.SelectContentControlsByTitle("Hecho").Item(1).Range.Text = Hecho
'in an table (first table, first cell)
ActiveDocument.Tables(1).Cell(1, 1).Range.Text = Hecho
End
lbl_Exit:
Exit Function
End Function
|
|
#2
|
|||
|
|||
|
Thank you so much.
Yes, and it wasn't what I was looking for. I explain. I wanted something that would update only when I added those characters. The document in which I am going to apply it is a list of objectives, and I want to obtain the percentage of those that I am achieving. That's why I want it to update as it marks completion. You understand me? |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Select a specific number of characters in word using VBA
|
mrwoggie | Word VBA | 1 | 01-18-2022 03:08 PM |
| Looking for a macro for word count in one specific column of table, only rows with white background | mobj | Word VBA | 2 | 10-17-2019 03:09 AM |
Deleting Characters in a specific location in Word 2010
|
ppayaw | Word VBA | 8 | 12-13-2016 08:11 AM |
Custom ribbon button or shortcut for a specific function
|
Nicobisgaard | Word | 6 | 04-22-2015 04:39 AM |
Count characters on the fly
|
NobodysPerfect | Word VBA | 1 | 04-20-2014 03:39 PM |