TheSwamp
Code Red => VB(A) => Topic started by: Humbertogo on December 07, 2007, 05:50:52 AM
-
I'm wondering if is possible to aadtable
as next 4 rows with the last one have 4 columns
-
Take a look at MergeCells method in the Help file
Here is my old one I don't remember how it worked
Sub Merge_Cells()
Dim oSpace As AcadBlock
Set oSpace = ThisDrawing.ModelSpace
Dim pt(2) As Double
Dim oTable As AcadTable
Set oTable = oSpace.AddTable(pt, 4, 4, 1, 7)
ZoomExtents
Dim i As Long, j As Long
oTable.TitleSuppressed = True
oTable.HeaderSuppressed = True
For i = 0 To oTable.Rows - 1
For j = 0 To oTable.Columns - 1
oTable.SetCellType i, j, acTextCell
oTable.SetCellTextHeight i, j, 0.4
oTable.SetCellAlignment i, j, acMiddleCenter
oTable.SetText i, j, "Row " & CStr(i) & ": Column 0"
Next j
Next i
For i = 1 To oTable.Rows - 2
oTable.MergeCells i, i, 0, 3
Next
For i = 0 To oTable.Columns - 1
oTable.SetText oTable.Rows - 1, i, "Row " & CStr(oTable.Rows - 1) & ": Column " & CStr(i)
Next
oTable.RecomputeTableBlock True
oTable.Update
End Sub
~'J'~
-
thank you exact what i need
just a modification and it will working fine
For i = 0 To oTable.Rows - 2
-
In case if your table style haven't
title as I guess
Isn't it?
~'J'~