Adding KKKK in the cell

W

Wi$hma$teR

Help me please.
Can you provide me with formula or macros which will replace any text in
current cell (if formula was writing in this cell behind or before possible
text) with "X" and will leave empty cell the same?
 
J

Jean-Guy Marcil

Wi$hma$teR was telling us:
Wi$hma$teR nous racontait que :
Help me please.
Can you provide me with formula or macros which will replace any text
in current cell (if formula was writing in this cell behind or before
possible text) with "X" and will leave empty cell the same?

Try this:

'_______________________________________
Dim myCell As Cell

If Not Selection.Information(wdWithInTable) Then
MsgBox "Cursor must be in a table.", vbCritical, "Cancelled"
Exit Sub
End If

With Selection.Tables(1).Range
For Each myCell In .Cells
With myCell.Range
If Len(.Text) > 2 Then
.Text = "X"
End If
End With
Next
End With
'_______________________________________

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
[email protected]
Word MVP site: http://www.word.mvps.org
 
Top