Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-17-2015, 03:18 AM
PRA007's Avatar
PRA007 PRA007 is offline How to Extract Data from table based on pattern. Windows 7 32bit How to Extract Data from table based on pattern. Office 2010 32bit
Competent Performer
How to Extract Data from table based on pattern.
 
Join Date: Dec 2014
Location: Ahmedabad, Gujrat, India
Posts: 145
PRA007 is on a distinguished road
Default How to Extract Data from table based on pattern.


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?
Reply With Quote
  #2  
Old 03-17-2015, 09:37 PM
Guessed's Avatar
Guessed Guessed is offline How to Extract Data from table based on pattern. Windows 7 32bit How to Extract Data from table based on pattern. Office 2010 32bit
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,932
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

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
Reply With Quote
  #3  
Old 03-17-2015, 10:42 PM
PRA007's Avatar
PRA007 PRA007 is offline How to Extract Data from table based on pattern. Windows 7 32bit How to Extract Data from table based on pattern. Office 2010 32bit
Competent Performer
How to Extract Data from table based on pattern.
 
Join Date: Dec 2014
Location: Ahmedabad, Gujrat, India
Posts: 145
PRA007 is on a distinguished road
Default May be I Don't Know how to sort column in Microsoft word Table.

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
Reply With Quote
  #4  
Old 03-17-2015, 10:46 PM
gmayor's Avatar
gmayor gmayor is offline How to Extract Data from table based on pattern. Windows 7 64bit How to Extract Data from table based on pattern. Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

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
Reply With Quote
  #5  
Old 03-17-2015, 11:05 PM
PRA007's Avatar
PRA007 PRA007 is offline How to Extract Data from table based on pattern. Windows 7 32bit How to Extract Data from table based on pattern. Office 2010 32bit
Competent Performer
How to Extract Data from table based on pattern.
 
Join Date: Dec 2014
Location: Ahmedabad, Gujrat, India
Posts: 145
PRA007 is on a distinguished road
Default Thank You

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.
Reply With Quote
Reply

Tags
microsoft word 2010, table., vba code

Thread Tools
Display Modes


Similar Threads
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
How to Extract Data from table based on pattern. Extract Excel Data from Chart in Word cillianmccolgan Word 1 08-15-2014 01:42 AM
How to Extract Data from table based on pattern. Extract data from web - Take a long time edneco Excel Programming 11 06-28-2014 05:54 PM
How to Extract Data from table based on pattern. How to Extract key data from word iliauk Word 3 11-08-2013 04:37 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:22 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft