Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / November 2006

Tip: Looking for answers? Try searching our database.

Autonumber Field forms

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
rachitm@gmail.com - 22 Nov 2006 18:43 GMT
Is there a way I could Autonumber a column? I have an insert row button
for a table and I was wondering if I could make the first column
autonumber itself (1..2..3..) when I press the insert row button.

#    PARENT NAME
1.                 <field form>
2.                 <field form>
3.                 <field form>

......and so on.....
Greg Maxey - 22 Nov 2006 19:59 GMT
If you build your table with a SEQ field in column 1 row 2 using
something like { SEQ myCol} then a macro like this may do:

Sub ScratchMacro()
Dim oTbl As Word.Table
Dim myRng As Range
Dim i As Long
If Selection.Information(wdWithInTable) Then
 Set oTbl = Selection.Tables(1)
 oTbl.Rows.Add
 i = oTbl.Rows.Count
 Set myRng = oTbl.Cell(i, 1).Range
 myRng.Collapse
 oTbl.Range.Fields.Add myRng, wdFieldEmpty, Text:="SEQ myCol"
Else
 MsgBox "The cursor is not in a table"
End If
End Sub

> Is there a way I could Autonumber a column? I have an insert row button
> for a table and I was wondering if I could make the first column
[quoted text clipped - 6 lines]
>
> ......and so on.....
rachitm@gmail.com - 27 Nov 2006 18:22 GMT
Thanks Greg for your help! This works :)

> If you build your table with a SEQ field in column 1 row 2 using
> something like { SEQ myCol} then a macro like this may do:
[quoted text clipped - 25 lines]
> >
> > ......and so on.....

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.