Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
Hi guys i need advice on VBA ( ms word )
Let me explain what i am trying to do is that , firstly i have done a userform in MS words. In one of my frame there is this label, when the user clicks on it , it will put data from textbox1 to Excel workbook named "book1.xlsx" and split the words by " ; " . This is done because the text box has multple value in a string which paste into a cell of excel which then split into words to row of cells in column A . Resulting like a normal table with datas in excel. right now what i need help is that i would like to copy down to the last row of data ( column A to G ) and paste the rage of data into my words by DataType:=wdPasteOLEObject on to a book mark call "excel table" This is my code i have writen so far Private Sub Label17_Click() Application.ScreenUpdating = False Set objexcel = CreateObject("excel.Application") Set wb = objexcel.Workbooks.Open("C:\Desktop\book1.xlsx") wb.Worksheets("Sheet1").Range("A2") = TextBox1.Value Dim sText As String, arText sText = wb.Worksheets("Sheet1").Range("A2").Value arText = Split(sText, ";") wb.Worksheets("Sheet1").Range("A2:A100" & CStr(16 + UBound(arText))).Value = wb.Worksheets("Sheet1").WorksheetFunction.Transpos e(arText) Application.ScreenUpdating = True end sub Thanks in advance ! cheers Last edited by andywsw : May 8th 12 at 04:49 AM |
Reply |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Exporting Word document into excel automatically without opening excel | Microsoft Word Help | |||
Exporting Data into WORD Table | Tables | |||
exporting data from reviewing pane in Word | Microsoft Word Help | |||
Exporting Word Form Data into Excel | Microsoft Word Help |