Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.word.tables
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Sorting Text In Table

I am afraid not.

--
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, originally posted via msnews.microsoft.com
"Akash Anu" Akash wrote in message
...
Hi. I have a different question, please read on...

I'm able to sort text in a table. Mine is a 2-column table, and every 20
new
rows I need to select all the rows in the table and click on 'Sort'.

So can it somehow be possible that as soon as I enter a new row it goes
into
its right place in the table so that the table looks sorted ? Can it be
that
automatic ??

Thanks a lot.
-- Akash.

"Helmut Weber" wrote:

Hi Tiffany,

without even trying to handle merged cells,
without nested tables and
without cells containing anything but text,

and assuming you know something about macros,
then, if the insertion point is in a table,
in principle:

Sub SortRows()
Dim r As Long ' rows
Dim c As Long ' columns
Dim oTbl As Table
Dim oRow As Row
Dim oArr() As String
Set oTbl = Selection.Tables(1)
For r = 1 To oTbl.Rows.Count
oArr = Split(oTbl.Rows(r).Range, chr(13) & chr(7))
WordBasic.sortarray oArr
For c = 2 To UBound(oArr)
' MsgBox c - 1 & " = [" & oArr(c) & "]"
oTbl.Rows(r).Cells(c - 1).Range.Text = oArr(c)
Next
Next
End Sub


--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"


 
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 Format Style vs. Table Text Style WebColin Page Layout 11 December 1st 05 11:29 PM
Document Styles should be assignable to fonts in Table AutoFormat Natasha A. Tables 5 November 11th 05 05:49 PM
Making a table "hidden text" Shubha Tables 2 June 14th 05 10:13 PM
Making a table "hidden text" Shubha Tables 0 June 10th 05 08:07 PM
Table headers/footers and layout Keith Page Layout 1 April 8th 05 07:37 PM


All times are GMT +1. The time now is 05:43 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"