|
-
Jul 3rd, 2003, 03:28 AM
#1
Thread Starter
Member
How to Create Table In Ms words
Hi
I have to Generate the report in tabular form in Words
how to do it??
-
Jul 3rd, 2003, 06:52 AM
#2
Here's the general idea - another way to do this is to record a macro in word, design a table, then stop the recording & look at the vb editor window to pinch the code Word / the macro has produced for you...
VB Code:
Private Sub CommandButton1_Click()
Dim rngDefault As Range
Dim tblTest As Table
Set rngDefault = ActiveDocument.Range(Start:=0, End:=0)
Set tblTest = ActiveDocument.Tables.Add _
(Range:=rngDefault, numrows:=1, numcolumns:=3)
With tblTest
.Rows(1).Cells(1).Select
Selection.Text = "1"
.Rows(1).Cells(2).Select
Selection.Text = "2"
.Rows(1).Cells(3).Select
Selection.Text = "3"
End With
End Sub
-
Jul 4th, 2003, 12:20 AM
#3
Thread Starter
Member
Thanks it work really fine
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|