![]() |
#1
|
||||
|
||||
![]()
I Have Table containing following pattern.
![]() I want to extract the same table having no value in field3 (colored in blue as new table after the source table with source table unaltered and the numbering of target table to be changed to text so as to preserve numbering. is it possible? |
#2
|
||||
|
||||
![]()
You could write a macro but it is faster to do it manually for a one-off task.
I would select the table and then sort it on the last column. This puts all the rows containing something in Field 3 in one continuous block so it is easy to select and delete.
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#3
|
||||
|
||||
![]()
I have used help from Microsoft page.
Sort a single column in a table Select the column that you want to sort. Under Table Tools, on the Layout tab, in the Data group, click Sort. Under My list has, click Header row or No header row. Click Options. Under Sort options, select the Sort column only check box. Click OK. But it's not giving What I Want. I have Tried Pasting The Content in Excel but when my table have images it is not taking it as boanks. Please Suggest It worked but the only probem i face is numbering on first column which gets totally messed up while. I will have to wait till i figure it out how to write a macro for it. Thanks for reply it will surely help in the future as I Didn't knew this feature of word to sort the table. Thank you very much |
#4
|
||||
|
||||
![]()
I would agree with Andrew, but for the numbering, which appears to be paragraph numbering, and with such numbering the number sequence would be lost, so I guess it may need a macro after all. The following should work with a table format like that shown that has auto numbered cells:
Code:
Sub ProcessTable() Dim oTable As Table Dim oRow As Row Dim oCell As Range Dim LastRow As Long, i As Long If Not Selection.Information(wdWithInTable) Then MsgBox "Put the cursor in the table to be processed." GoTo lbl_Exit End If Set oTable = Selection.Tables(1) LastRow = oTable.Rows.Count For i = LastRow To 2 Step -1 Set oRow = oTable.Rows(i) Set oCell = oRow.Cells(1).Range oCell.ListFormat.ConvertNumbersToText oCell.End = oCell.End - 1 oCell.Text = Replace(oCell.Text, Chr(9), "") If Len(oRow.Cells(4).Range) > 2 Then oRow.Delete Next i lbl_Exit: Exit Sub End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#5
|
||||
|
||||
![]()
Thank you Mr. Mayor. Apology to Mr. Lockton for not understanding the instruction. The Problem was only Numbering. After trying Macro Provided By Mr. Mayor I came to know that first thing is to convert numbering to text. After that sorting works fine. But having Macro is great. Thank you Very much Gentlemen.
|
![]() |
Tags |
microsoft word 2010, table., vba code |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Extract duplicates in table | goran.c | Excel | 0 | 01-21-2015 12:47 AM |
Retrieving data from data base based on text selection | capitala | PowerPoint | 0 | 12-10-2014 08:10 AM |
![]() |
cillianmccolgan | Word | 1 | 08-15-2014 01:42 AM |
![]() |
edneco | Excel Programming | 11 | 06-28-2014 05:54 PM |
![]() |
iliauk | Word | 3 | 11-08-2013 04:37 PM |