Thread: Word to Excel
View Single Post
 
Old 09-09-2020, 07:51 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,164
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

OK, as a barebones solution, this macro will put the results into your VBA Immediate Window. You can then copy/paste that output it to Excel and do a global search and replace to remove the (tool: ) bits.
Code:
Sub ToolTime()
  Dim sNum As String, sTool As String, iPos As Integer
  Dim aPara As Paragraph, sParaText As String, sData As String
  For Each aPara In ActiveDocument.Paragraphs
    If aPara.Range.ListFormat.ListString <> "" Then sNum = aPara.Range.ListFormat.ListString
    sParaText = aPara.Range.Text
    iPos = InStr(sParaText, "(tool:")
    If iPos > 0 Then
      sTool = Mid(sParaText, iPos)
      sData = sData & sNum & vbTab & sTool
    End If
  Next aPara
  Debug.Print sData
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote