Results 1 to 3 of 3

Browse Word Document data into excel sheet

Threaded View

Parth007 Browse Word Document data... 08-11-2015, 06:16 AM
Parth007 Re: Browse Word Document data... 08-11-2015, 06:40 AM
Parth007 Re: Browse Word Document data... 08-11-2015, 07:43 AM
  1. #1
    Valued Forum Contributor Parth007's Avatar
    Join Date
    12-01-2014
    Location
    Banglore
    MS-Off Ver
    2010
    Posts
    879

    Post Browse Word Document data into excel sheet

    Hi Team,

    1) I need to Browse the Folder to select a particular file (user Choice)
    once selected it should copy all data from word file & paste it in Excel sheet("A1")

    2) after which it sorts
    3) Plot formula to track if the Column D have value greater than 0

    Column should result if any cell in column d have value greater than 0


    I have some code..I am able to sort it via code..

    But cant get through folder select & paste word data in excel.. & plotting formula..
    I tried seqarching for code.. but couldnt get through right one
    Please assist

    Thank You



    Below is the code for folder select & select a file.. but how to modify it so that word data gets pasted in excel A1

    
    
    Sub GetFormData()
         'Note: this code requires a reference to the Word object model
        Application.ScreenUpdating = False
        Dim wdApp As New Word.Application
        Dim wdDoc As Word.Document
        Dim CCtrl As Word.ContentControl
        Dim strFolder As String, strFile As String
        Dim WkSht As Worksheet, i As Long, j As Long
        strFolder = GetFolder
        If strFolder = "" Then Exit Sub
        Set WkSht = ActiveSheet
        i = WkSht.Cells(WkSht.Rows.Count, 1).End(xlUp).Row
        strFile = Dir(strFolder & "\*.doc", vbNormal)
    '    While strFile <> ""
    '        i = i + 1
    '        Set wdDoc = wdApp.Documents.Open(Filename:=strFolder & "\" & strFile, AddToRecentFiles:=False, Visible:=False)
    '        With wdDoc
    '            j = 0
    '            For Each CCtrl In .ContentControls
    '                j = j + 1
    '                WkSht.Cells(i, j) = CCtrl.Range.Text
    '            Next
    '        End With
    '        wdDoc.Close SaveChanges:=False
    '        strFile = Dir()
    '    Wend
        wdApp.Quit
        Set wdDoc = Nothing: Set wdApp = Nothing: Set WkSht = Nothing
        Application.ScreenUpdating = True
    End Sub
     
    Function GetFolder() As String
        Dim oFolder As Object
        GetFolder = ""
        Set oFolder = CreateObject("Shell.Application").BrowseForFolder(0, "Choose a folder", 0)
        If (Not oFolder Is Nothing) Then GetFolder = oFolder.Items.Item.Path
        Set oFolder = Nothing
    End Function
    Last edited by Parth007; 08-11-2015 at 09:01 AM.
    Regards
    Parth

    I appreciate your feedback. Hit * if u Like.
    Rules - http://www.excelforum.com/forum-rule...rum-rules.html

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How to export data from word document to excal sheet?
    By aritradey in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-01-2014, 09:44 AM
  2. Excel Sheet Problem when Using in Word Document
    By BIGTREV in forum Excel General
    Replies: 0
    Last Post: 03-21-2013, 02:38 PM
  3. Excel Spread Sheet to form word document
    By Screamer in forum Excel General
    Replies: 1
    Last Post: 09-06-2007, 08:24 AM
  4. Copy rows from excel sheet to a word document
    By ashishprem in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-27-2006, 08:55 AM
  5. [SOLVED] Want to insert Excel sheet in Word document - comes out too big.
    By Chicago in forum Excel General
    Replies: 4
    Last Post: 03-30-2006, 06:55 PM
  6. Replies: 2
    Last Post: 07-11-2005, 12:05 PM
  7. Replies: 0
    Last Post: 02-28-2005, 06:11 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1