killoberry.blogg.se

Text to table word macro
Text to table word macro












  1. #Text to table word macro code
  2. #Text to table word macro password

That box is a UserForm and is for the start. Protect Type:=Prot, Password:=Pwd, Noreset:=TrueĮnd Sub Cheers Paul Edstein (Fmr MS MVP - Word) Rows(Selection.Cells(1).RowIndex + 1).Range.FormFields 'StrNms = StrNms & "|" & Left(FmFld.Name, Len(FmFld.Name) - 2) & Format(i, "00") Split BeforeRow:=.Rows(Selection.Cells(1).RowIndex + 1) If MsgBox("Add new row?", vbQuestion + vbYesNo) = vbYes Then J = ActiveDocument.Range(.Tables(1).Range.Start.

#Text to table word macro password

' example, formfield names on tabe row 2, which is formfield row 1, end with 01.ĭim i As Long, j As Long, FmFld As FormField, Prot As VariantĬonst Pwd As String = "" 'Insert password here ' name ending in a two-digit number corresponding to the formfield row. ' As coded, the formfield names assume each column uses a different formfield ' If you need the formfields named, activate the commented-out code. 'This macro adds another row to the table.

#Text to table word macro code

Some revisions to the code are required to insert the new row before the existing last row, but Any rows you insert above that row will automatically be included in the formula's scope. Your initial post refers to the use of "=SUM(ABOVE) in each column". I have used legacy form fields throughout. After the extra rows have been added, the cursor is sitting on the first field in the "new" row 3 (which would, in effect, now be row 5) The totals in the current row 5 still add up The calculations in columns 6 and 7 work for the new row Rows 3 and 4 are duplicated, with all fields cleared and the dropdown in column 3 showing the first option If the user needs to add additional rows, the code required to ensure: In order for Word to calculate the totals in row 5, rows 3 and 4 are merged in columns 3 to 7 - I used =SUM(ABOVE) in each column. Row 5 is the totals of each column 4 to 7. Row 4 is for user input in column 2 only and carries the macro to add additional rows if required upon exit of the field. Row 3 is for the user to input text in columns 1 and 2, there's a dropdown in column 3, dollar values are input in columns 4 and 5, column 6 automatically calculates the GST from the dollar value in column 5 and column 7 automatically gives the total of Row 2 is the titles of all columns, with columns 1 and 2 merged.

text to table word macro

Row 1 is the title of the table and is all seven columns merged. In Word 2016, within a locked form, I have a table with five rows and seven columns.














Text to table word macro