I have done vba in access and excel but in word I can't seem to get this
right probably because it is right in front of my face.

How do I use the value from a word table cell in a macro?

The value of cell (1,1) will determine an action on cell(1,2) of table(1)
and the value of Cell (1,1) needs to be displayed in a msgbox.


--
JerryB

Re: determine table cell value by YiShusen

YiShusen
Wed Jan 18 16:50:35 CST 2006

hope this will help you
http://www.jojo-zawawi.com/code-samples-pages/code-samples.htm#T


Re: determine table cell value by JerryMB

JerryMB
Wed Jan 18 19:05:02 CST 2006

Thanks but if what I was looking for was there I didn't see it. But looking
through it I found an answer to a borders question for a different project
--Thanks
--
JerryB


"YiShusen@gmail.com" wrote:

> hope this will help you
> http://www.jojo-zawawi.com/code-samples-pages/code-samples.htm#T
>
>

RE: determine table cell value by JerryMB

JerryMB
Wed Jan 18 19:22:02 CST 2006

Found it in a earlier discussion - must be my bad search technique

myString = ActiveDocument.Table(1).Cell(2,2).Range.Text


--
JerryB


"JerryMB" wrote:

> I have done vba in access and excel but in word I can't seem to get this
> right probably because it is right in front of my face.
>
> How do I use the value from a word table cell in a macro?
>
> The value of cell (1,1) will determine an action on cell(1,2) of table(1)
> and the value of Cell (1,1) needs to be displayed in a msgbox.
>
>
> --
> JerryB

Re: determine table cell value by Doug

Doug
Wed Jan 18 23:09:16 CST 2006

That will include the end of cell marker in myString. To exclude it, use

Dim myrange as Range
Set myrange = ActiveDocument.Tables(1).Cell(2, 2).Range
myrange.End = myrange.End - 1
MsgBox myrange

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"JerryMB" <JerryMB@discussions.microsoft.com> wrote in message
news:97BFB6BD-23A3-4388-898D-1E36FCE2B8DC@microsoft.com...
> Found it in a earlier discussion - must be my bad search technique
>
> myString = ActiveDocument.Table(1).Cell(2,2).Range.Text
>
>
> --
> JerryB
>
>
> "JerryMB" wrote:
>
>> I have done vba in access and excel but in word I can't seem to get this
>> right probably because it is right in front of my face.
>>
>> How do I use the value from a word table cell in a macro?
>>
>> The value of cell (1,1) will determine an action on cell(1,2) of table(1)
>> and the value of Cell (1,1) needs to be displayed in a msgbox.
>>
>>
>> --
>> JerryB



Re: determine table cell value by JerryMB

JerryMB
Thu Jan 19 20:13:02 CST 2006

Thanks Doug that is cleaner than the method I used -- Basicly
strMystr2= Mid(strMystr,1,(Len(strMystr)-2)
--
JerryB


"Doug Robbins - Word MVP" wrote:

> That will include the end of cell marker in myString. To exclude it, use
>
> Dim myrange as Range
> Set myrange = ActiveDocument.Tables(1).Cell(2, 2).Range
> myrange.End = myrange.End - 1
> MsgBox myrange
>
> --
> Hope this helps.
>
> Please reply to the newsgroup unless you wish to avail yourself of my
> services on a paid consulting basis.
>
> Doug Robbins - Word MVP
>
> "JerryMB" <JerryMB@discussions.microsoft.com> wrote in message
> news:97BFB6BD-23A3-4388-898D-1E36FCE2B8DC@microsoft.com...
> > Found it in a earlier discussion - must be my bad search technique
> >
> > myString = ActiveDocument.Table(1).Cell(2,2).Range.Text
> >
> >
> > --
> > JerryB
> >
> >
> > "JerryMB" wrote:
> >
> >> I have done vba in access and excel but in word I can't seem to get this
> >> right probably because it is right in front of my face.
> >>
> >> How do I use the value from a word table cell in a macro?
> >>
> >> The value of cell (1,1) will determine an action on cell(1,2) of table(1)
> >> and the value of Cell (1,1) needs to be displayed in a msgbox.
> >>
> >>
> >> --
> >> JerryB
>
>
>