Reply
 
Thread Tools Display Modes
  #1   Report Post  
OliverTwist
 
Posts: n/a
Default counting rows of a given table

hi all,
i'm using a log-analyzer tool of some measurements with output of those into
a word document creating a simple table.
i wrote a macro (with help of this newsgroup posts *g*) to make verdicts
over passed and failed tests.
I want to apply this macro to every row of the tables, but with varying
maesurements, the size of the table changes an i need something like a "row
counter" to implement in my macro to update my FOR x IN ... procedure.

here is my macro so far with constant row number "Table_Rows":

Sub Verdict_Return()
'
' Verdict_Return Macro
' Macro created 26/04/2005 by opgenrhe
'
ActiveWindow.ScrollIntoView Obj:=Selection.Range, Start:=True

Dim Table_Rows As Integer
Table_Rows = 4

For i = 1 To Table_Rows

Selection.Tables(1).Cell(i, 1).Select
Base = Selection.Calculate
Selection.Tables(1).Cell(i, 2).Select
Variance = Selection.Calculate
Selection.Tables(1).Cell(i, 3).Select
Meas = Selection.Calculate

UpperLimit = Base + Variance
LowerLimit = Base - Variance

Selection.Tables(1).Cell(i, 4).Select

If LowerLimit = Meas And Meas = UpperLimit Then

Selection.Font.Color = wdColorGreen
Selection.TypeText Text:="PASS"

Else: Selection.Font.Color = wdColorRed
Selection.TypeText Text:="FAIL"
End If

Next i

End Sub

Any help would be greatly appreciated.

Oliver
  #2   Report Post  
Greg
 
Posts: n/a
Default

Are you looking for something like:
For i = 1 To ActiveDocument.Tables(1).Rows.Count

  #3   Report Post  
OliverTwist
 
Posts: n/a
Default

Perfect! Thank you so much Greg!
You saved many hours of working time!

Hope we have contact again,
BR,

Oliver

"Greg" wrote:

Are you looking for something like:
For i = 1 To ActiveDocument.Tables(1).Rows.Count


Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Table headers/footers and layout Keith Page Layout 1 April 8th 05 07:37 PM
Table AutoFormats vs. Table Styles confusion Tony Jollans Tables 5 March 6th 05 07:18 PM
2002 Word Table Rows Sarah LeV Tables 3 January 28th 05 02:31 AM
ALT+SHIFT+Arrow shortcut to move table rows Nicola Tables 3 December 16th 04 09:58 PM
Remove Rows from a Table after merging Kevin L Mailmerge 1 December 9th 04 11:13 AM


All times are GMT +1. The time now is 02:02 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"