Sorry, my problem explanation in lengthy, but I need to explain exactly what I am doing to try to field out the obvious (but well meaning) solutions
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Dynamic Reports / Dynamic tables
Home » Forums » AskWoody support » Productivity software by function » Visual Basic for Applications » Dynamic Reports / Dynamic tables
- This topic has 5 replies, 4 voices, and was last updated 24 years ago.
Viewing 1 reply threadAuthorReplies-
WSgwhitfield
AskWoody LoungerMarch 27, 2001 at 7:33 am #1780809Cathy,
A couple of thoughts.
You might try putting the data in, and then createing the table after all the data has been inserted.
You might be able to create the tables in Excel, then paste them into Word. This has the advantage that you can select all cells to be formatted in one go- eg:
Range(“A1,B2,C3,D4,D2”).Interior.ColorIndex = 35Do you have a predominate format- eg, 90% of cells with one type of formatting, then 10% to be changed separately- so that you could format a table in one go?
Is it possible for you to create the entire report purely in Excel?
Just a few random thoughts.
-
cathyj
GuestMarch 27, 2001 at 10:34 am #1780812Hi Geoff
Thanks for your reply. Excel does not have the features required to publish a good looking report document. I specifically require Word for styles, Word wrapping, table of contents, headers/footers, sections, etc – not that I am anti-Excel – I am already using Excel to create the chart components of my system (working very well).
Could you please expand on your first idea – what do you mean by putting the data in and then creating the table?
Any other suggestions are welcome!!
Cathy
-
WSjscher2000
AskWoody LoungerMarch 27, 2001 at 10:49 am #1780813Different Jeff here.
If you make Word visible and watch can you see where it is bogging down?
It might help to create a few tables with the desired number of columns and header row formats and save them as AutoText. You then could check the data for the number of columns, insert the table and Selection.TypeText data in without formatting each cell, .MoveRight wdCell to proceed to the next cell/row, and .MoveDown wdLine to exit the table. You’ll probably need to experiment with the border settings to get that to work just right. (If you are using ranges, I’m not sure what the equivalent methods are.)
-
WSgwhitfield
AskWoody LoungerMay 4, 2001 at 9:23 am #1780814Cathy,
Here’s some code which I built ages ago. It uses the Selection a lot, which I no longer really like- but we’ve used this so seldom, it’s not useful for me to change it!
Just before this code, I’ve built up text with tab separators
Selection.WholeStory Selection.ConvertToTable Separator:=wdSeparateByTabs, _ NumColumns:=4, NumRows:=25, Format:=wdTableFormatNone, _ ApplyBorders:=True, ApplyShading:=True, ApplyFont:=True, _ ApplyColor:=True, ApplyHeadingRows:=True, _ ApplyLastRow:=False, ApplyFirstColumn:=True, _ ApplyLastColumn:=False, AutoFit:=False Selection.Tables(1).Rows.SetLeftIndent LeftIndent:=12, _ RulerStyle:=wdAdjustNone Selection.Tables(1).Columns(1).SetWidth ColumnWidth:=75, _ RulerStyle:=wdAdjustNone Selection.Tables(1).Columns(2).SetWidth ColumnWidth:=320, _ RulerStyle:=wdAdjustNone Selection.Tables(1).Columns(3).SetWidth ColumnWidth:=55, _ RulerStyle:=wdAdjustNone Selection.Tables(1).Columns(4).SetWidth ColumnWidth:=65, _ RulerStyle:=wdAdjustNone Selection.Font.Name = "Arial" Selection.Font.Size = 8 With Selection.ParagraphFormat .SpaceBefore = 0 .SpaceAfter = 0 End With With Selection.Tables(1) With .Borders(wdBorderLeft) .LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth150pt .ColorIndex = wdAuto End With With .Borders(wdBorderRight) .LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth150pt .ColorIndex = wdAuto End With With .Borders(wdBorderTop) .LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth150pt .ColorIndex = wdAuto End With With .Borders(wdBorderBottom) .LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth150pt .ColorIndex = wdAuto End With With .Borders(wdBorderHorizontal) .LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth075pt .ColorIndex = wdAuto End With With .Borders(wdBorderVertical) .LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth075pt .ColorIndex = wdAuto End With .Borders.Shadow = False End With Selection.Sort ExcludeHeader:=False, FieldNumber:="Column 1", _ SortFieldType:=wdSortFieldAlphanumeric, _ SortOrder:=wdSortOrderAscending, FieldNumber2:="Column 2", _ SortFieldType2:=wdSortFieldAlphanumeric, _ SortOrder2:=wdSortOrderAscending, FieldNumber3:="", _ SortFieldType3:=wdSortFieldAlphanumeric, _ SortOrder3:=wdSortOrderAscending Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft
It’s not pretty code, but it did the job I needed to do at the time.
-
-
-
WSRichP
AskWoody LoungerMay 4, 2001 at 7:27 am #1783016Don’t know if you ever solved this or not, but one thought I had was to recommend creating the tables in Access and then using the Transfer action to place them in Word. I believe if you run an Append query that writes all the table values to an Access table, you can pre-set the Field properties and they should be retained in Word. That way all you would have to do is the visual formatting in Word.
If you found another faster way, I would love to see it.
Thanks,
Rich P.
Viewing 1 reply thread -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
DBOS Advanced Network Analysis
by
Kathy Stevens
1 hour, 58 minutes ago -
Microsoft Edge Launching Automatically?
by
healeyinpa
2 hours, 41 minutes ago -
Google Chrome to block admin-level browser launches for better security
by
Alex5723
4 hours, 39 minutes ago -
iPhone SE2 Stolen Device Protection
by
Rick Corbett
5 hours, 21 minutes ago -
Some advice for managing my wireless internet gateway
by
LHiggins
1 hour, 50 minutes ago -
NO POWER IN KEYBOARD OR MOUSE
by
HE48AEEXX77WEN4Edbtm
6 hours, 16 minutes ago -
A CVE-MITRE-CISA-CNA Extravaganza
by
Nibbled To Death By Ducks
14 hours, 8 minutes ago -
Sometimes I wonder about these bots
by
Susan Bradley
10 hours, 25 minutes ago -
Does windows update component store “self heal”?
by
Mike Cross
28 minutes ago -
Windows 11 Insider Preview build 27858 released to Canary
by
joep517
1 day, 4 hours ago -
Pwn2Own Berlin 2025: Day One Results
by
Alex5723
1 day, 3 hours ago -
Windows 10 might repeatedly display the BitLocker recovery screen at startup
by
Susan Bradley
44 minutes ago -
Windows 11 Insider Preview Build 22631.5409 (23H2) released to Release Preview
by
joep517
1 day, 6 hours ago -
Windows 10 Build 19045.5912 (22H2) to Release Preview Channel
by
joep517
1 day, 6 hours ago -
Kevin Beaumont on Microsoft Recall
by
Susan Bradley
19 hours, 23 minutes ago -
The Surface Laptop Studio 2 is no longer being manufactured
by
Alex5723
1 day, 14 hours ago -
0Patch, where to begin
by
cassel23
1 day, 8 hours ago -
CFPB Quietly Kills Rule to Shield Americans From Data Brokers
by
Alex5723
2 days, 4 hours ago -
89 million Steam account details just got leaked,
by
Alex5723
1 day, 16 hours ago -
KB5058405: Linux – Windows dual boot SBAT bug, resolved with May 2025 update
by
Alex5723
2 days, 13 hours ago -
A Validation (were one needed) of Prudent Patching
by
Nibbled To Death By Ducks
2 days, 4 hours ago -
Master Patch Listing for May 13, 2025
by
Susan Bradley
1 day, 15 hours ago -
Installer program can’t read my registry
by
Peobody
8 hours, 1 minute ago -
How to keep Outlook (new) in off position for Windows 11
by
EspressoWillie
2 days, 1 hour ago -
Intel : CVE-2024-45332, CVE-2024-43420, CVE-2025-20623
by
Alex5723
2 days, 9 hours ago -
False error message from eMClient
by
WSSebastian42
3 days ago -
Awoke to a rebooted Mac (crashed?)
by
rebop2020
3 days, 9 hours ago -
Office 2021 Perpetual for Mac
by
rebop2020
3 days, 10 hours ago -
AutoSave is for Microsoft, not for you
by
Will Fastie
8 hours, 6 minutes ago -
Difface : Reconstruction of 3D Human Facial Images from DNA Sequence
by
Alex5723
3 days, 14 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.