Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selecting current cell in WORD 2010

Status
Not open for further replies.

wmbb

Technical User
Jul 17, 2005
320
NL
How do I select the cell in the table where the cursus is located ?
I need to select the current cell and replace all text in this cell with a variable.
The document can contain more tables but i need the active table and active cell.

Any suggestions ?

Thanks in advance.
 
Would something like this do the trick for you?
Code:
[COLOR=#4E9A06]'Store all text for other use[/color]
celltext = Selection.Cells(1).Range.Text

[COLOR=#4E9A06]'cut off cell end marker[/color]
celltext = Replace(celltext, Chr(7), "")

[COLOR=#4E9A06]'Replace cell text with your variable[/color]
Selection.Cells(1).Range.Text = "<placeholder 1>"
?

“Knowledge is power. Information is liberating. Education is the premise of progress, in every society, in every family.” (Kofi Annan)
Oppose SOPA, PIPA, ACTA; measures to curb freedom of information under whatever name whatsoever.
 
Does it help?

“Knowledge is power. Information is liberating. Education is the premise of progress, in every society, in every family.” (Kofi Annan)
Oppose SOPA, PIPA, ACTA; measures to curb freedom of information under whatever name whatsoever.
 
Sorry for this late reaction but the code you provided works for me.
Thank you very much.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top