Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Word
application.errors
conversions
docmanagement
drawing.graphics
formatting.longdocs
international
internet.assistant
mail
mailmerge.fields
menustoolbars
newusers
numbering
oleinterop
pagelayout
printingfonts
setup.networking
spelling.grammar
tables
vba.addins
vba.beginners
vba.customization
vba.general
vba.userforms
web.authoring
word6-7macros
word97vba
  
 
date: Fri, 10 Oct 2008 00:01:02 -0700,    group: microsoft.public.word.vba.general        back       


table formatting and cell selection   
i have programmed a working script that makes new tables and formats it the 
way we need it and partially populates it with data

now i have used pieces of code like this
   Selection.MoveRight unit:=wdCharacter, Count:=1
   Selection.MoveRight unit:=wdCharacter, Count:=(UBound(HulpGieken2) + 1) * 
(UBound(Hoeken2) + 1), Extend:=wdExtend
    Selection.Cells.Merge

now someone told me this way (selection.moveright and such) of coding is 
sensitive to error
he suggested using something like table.Range.Select but how do i select for 
example from cell(2,2) to cell(6,8)

thanks
date: Fri, 10 Oct 2008 00:01:02 -0700   author:   bert

RE: table formatting and cell selection   
i'm using word 2003

"bert" wrote:

> i have programmed a working script that makes new tables and formats it the 
> way we need it and partially populates it with data
> 
> now i have used pieces of code like this
>    Selection.MoveRight unit:=wdCharacter, Count:=1
>    Selection.MoveRight unit:=wdCharacter, Count:=(UBound(HulpGieken2) + 1) * 
> (UBound(Hoeken2) + 1), Extend:=wdExtend
>     Selection.Cells.Merge
> 
> now someone told me this way (selection.moveright and such) of coding is 
> sensitive to error
> he suggested using something like table.Range.Select but how do i select for 
> example from cell(2,2) to cell(6,8)
> 
> thanks
date: Fri, 10 Oct 2008 00:07:01 -0700   author:   bert

Re: table formatting and cell selection   
Dim myrange as Range
With ActiveDocument.Tables(1)
    Set myrange = .Cell(2, 2).Range
    myrange.End = .Cell(6, 8).Range.End
End With

Then, if you really need to select those cells

myrange.Select

-- 
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

"bert"  wrote in message 
news:8C3E781B-1835-4096-B05B-B5D6E9804D95@microsoft.com...
>i have programmed a working script that makes new tables and formats it the
> way we need it and partially populates it with data
>
> now i have used pieces of code like this
>   Selection.MoveRight unit:=wdCharacter, Count:=1
>   Selection.MoveRight unit:=wdCharacter, Count:=(UBound(HulpGieken2) + 1) 
> *
> (UBound(Hoeken2) + 1), Extend:=wdExtend
>    Selection.Cells.Merge
>
> now someone told me this way (selection.moveright and such) of coding is
> sensitive to error
> he suggested using something like table.Range.Select but how do i select 
> for
> example from cell(2,2) to cell(6,8)
>
> thanks
date: Fri, 10 Oct 2008 18:47:06 +1000   author:   Doug Robbins - Word MVP

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us