There's no equivalent of
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
but you could hit a menu button, leaving the cursor at your symbol:
in Thisdocument:
Option Explicit
Private Sub Document_Open()
Dim CB As CommandBar, CBC As CommandBarControl
Set CB = Application.CommandBars.ActiveMenuBar
CB.Reset
Set CBC = CB.Controls.Add(msoControlButton, , , , True)
CBC.FaceId = 342 ' my favorite
CBC.OnAction = "Doit"
End Sub
Private Sub Document_Close()
Application.CommandBars.ActiveMenuBar.Reset
End Sub
Sub Doit()
Const TblArg = "XO", TblVal = "OX"
Dim ch$, i%
Selection.Collapse wdCollapseStart
ch = Chr$(Asc(Selection.Text & " "))
i = InStr(1, TblArg, ch)
If i > 0 Then
Selection.Delete
Selection.TypeText Mid$(TblVal, i, 1)
End If
End Sub
> I'm trying to set up a roster where I can click on a symbol in front
> of a person's name and it will change from an "X" to a "O".
[quoted text clipped - 12 lines]
>
> John
Dave D-C - 12 Sep 2007 21:12 GMT
Of course, to make it "dynamic", you would want globals
TblArg$ and TblVal$
and set them to what you want, when you want.
>There's no equivalent of
>Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
[quoted text clipped - 47 lines]
>http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
>----= East and West-Coast Server Farms - Total Privacy via Encryption =----