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
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top