vba - Automatically add rows into a MS Word table in a loop as long as you read data from the excel sheet -
i'm vba newbie , having lots of errors , problems go on task. appreciated. basically have textbox (textbox1) in word doc. have users type in. it'll number , text references folder excel files numbers name. all excel files in folder has same formatting (created same template), number of rows in each file differs 1 another. my boss wants me create vba code in word import data excel word doc, problem occurs varying number of rows in each file, users can select existing file in folder. someone suggested creating rows in loop long there data pull excel, cannot code work. keeps failing i'm setting word table cell , excel cell equal each other (which don't know i'm doing right). here have far: private sub commandbutton1_click() dim tbl table dim row row set tbl = activedocument.tables(3) set row = tbl.rows.add(beforerow:=tbl.rows(1)) tbl.rows(1).range.formattedtext = tbl.rows(2).range.formattedtext '~~~> required above code inserts blank row...