If you want to copy a specific range from a word table to excel.For Example the below code will copy the data from second row of table (ignore first row -- header) and will paste the data into excel.
Sub copy_all_the_data_skip_header()
Dim doc As New Word.Application
Dim abc As Word.Range
doc.Visible = True
' TOOL -> REFRENCE-> MICROSOFT WORD
Documents.Open "C:\Documents and Settings\achamanlalko\Desktop\WORD TABLE.doc"
' it will copy from (row 2 col 1) till (row 7 and col 3) will ignore the first row.
Set abc = doc.ActiveDocument.Range( _
Start:=doc.ActiveDocument.Tables(1).Cell(2, 1).Range.Start, _
End:=doc.ActiveDocument.Tables(1).Cell(7, 3).Range.End)
abc.Select
doc.Selection.Copy
ThisWorkbook.Activate
Sheets(1).Range("a2").Select
ActiveSheet.Paste
doc.Quit
End Sub
Word Document
Excel Macro File
Subscribe to:
Post Comments (Atom)
Import data from SQL
Macro to import data from SQL using ADO connection string: Sub Import_data_from_SQL() ' Tools -> References -> Microsoft Active...
-
If you want to create the sales funnel in Excel. Snapshot below- Download the sample workbook and go through the steps mentioned in ...
-
If you want to add a new pop up button on mouse right click menu and as soon as you click on it . It shows you multiple buttons with macro a...
No comments:
Post a Comment