pastersmall.blogg.se

How to merge cells in a table in a word 2013 document
How to merge cells in a table in a word 2013 document












create a separate copy of the last cell in the table below the.If vsCurrentCellContent = "" And vpStopCellMode = FirstBlankCell Then VsPreviousCellContent = vsCurrentCellContent VsCurrentCellContent = Left(ActiveDocument.Tables(vmCurrentTableIndex).Cell(vsRow, vsCol).Range.Text, vsLenght)ĪctiveDocument.Tables(vmCurrentTableIndex).Cell(vsRow, vsCol).Range.Text = vsPreviousCellContent VsLenght = Len(ActiveDocument.Tables(vmCurrentTableIndex).Cell(vsRow, vsCol).Range.Text) - 2 Private Sub MoveCellContent(vpStopCellMode As StopCellMode)įor vsRow = vsStartRow To vsEndRow Step vsStepįor vsCol = vsStartCol To vsEndCol Step vsStep There is no cell to move to the left.", vbCritical, "Error") VsMsgBoxValue = MsgBox("This is the first cell. If vmCurrentCellRow = 1 And vmCurrentCellCol = 1 Then There is no cell to move to the right.", vbCritical, "Error") VsMsgBoxValue = MsgBox("This is the last cell. If vmCurrentCellRow = vmCurrentTableRowCount And vmCurrentCellCol = vmCurrentTableColCount Then Private Function CheckCurrentCellPosition() As Boolean VsMsgBoxValue = MsgBox("This command can be executed only within a table.", vbInformation, "Error") VmCurrentTableColCount = ActiveDocument.Tables(vmCurrentTableIndex).Columns.Count VmCurrentTableRowCount = ActiveDocument.Tables(vmCurrentTableIndex).Rows.Count VmCurrentTableIndex = ActiveDocument.Range(0, Selection.Tables(1).Range.End).Tables.Count Private Function SetModuleVariables(vpDirection As String) As Boolean Public Sub MoveCellsRightFirstBlankCell() (I hope someone will improve this macro by adding this feature). Work with splitted cells (Every row must have the same number of columns).Shift all the cells to the left until the first blank cell (Public Sub MoveCellsLeftFirstBlankCell).Shift all the cells to the left until the beginning of the table (Public Sub MoveCellsLeft).Shift all the cells to the right until the first blank cell (Public Sub MoveCellsRightFirstBlankCell).Shift all the cells to the right until the end of the table (Public Sub MoveCellsRight).So, I created a VBA macro (Word 2016) to do just that.

how to merge cells in a table in a word 2013 document

A few days ago I needed something like the one knezmilos asked for, and I din't find anything to do it.














How to merge cells in a table in a word 2013 document