Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-27-2023, 09:21 AM
RRB's Avatar
RRB RRB is offline Incrementing a style one number at a time Windows 11 Incrementing a style one number at a time Office 2021
Susan Flamingo
Incrementing a style one number at a time
 
Join Date: May 2014
Location: The Holy City of Jerusalem
Posts: 263
RRB is on a distinguished road
Default Incrementing a style one number at a time

Hi friends!

I was wondering if there is an *easy and elegant* way to automate this (if there isn't I just do it manually at the end)



I have text formatted (the text is simply a placeholder like"%%") with a style named styRunningNo.

I want Word to compute how many times this style is in the document for each occurrence and give it a number representing that time of occurrence.

So if there are 3 assurances to this instance it will replace %% with the number 4 and if I add another instance of that style it will replace the last instance with the number 5. etc.

Thank you all in advance!

Susan
Reply With Quote
  #2  
Old 02-27-2023, 12:00 PM
Charles Kenyon Charles Kenyon is offline Incrementing a style one number at a time Windows 11 Incrementing a style one number at a time Office 2021
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,140
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

Hi Susan,

Assign the style to a level in a MultiLevel List. The number will be at the beginning of the line.

If you use automatic paragraph numbering or bullets read Shauna Kelly's directions on numbering and bullets. Start with How to create numbered headings or outline numbering in Word 2007 and Word 2010. For large documents you must follow these directions or you will lose your hair!
(Mac version: Outline Numbering in Word for macOS - Best Practices - Brandwares)

This may seem a bit convoluted at first, but it really is not. Just follow the steps. Shauna Kelly's instructions use the built-in heading styles, but you can use any existing paragraph styles including your custom styles. There are, however advantages to using the built-in heading styles when you create a Table of Contents. Here are some more advantages: Why Use Word's Built-In Heading Styles? by Shauna Kelly Note, you can modify these built-in styles to look exactly the way you want.

Videos on this
https://www.youtube.com/watch?v=He_ob8ydc9E
https://www.youtube.com/watch?v=qbyTcWo52G4
https://www.youtube.com/watch?v=GevZOS-nCuw
https://www.youtube.com/watch?v=niD6VXPvAyU

The basic idea is that the numbering is set using the Define MultiLevel List dialog with each numbering level being attached to an existing paragraph style. Once you have this set up, you should not use the buttons for numbering in the Ribbon but rather apply the appropriate style for that level.

You can save a document with this as a template for future documents if you want so you will not need to do this every time.
Reply With Quote
  #3  
Old 02-27-2023, 02:45 PM
Guessed's Avatar
Guessed Guessed is offline Incrementing a style one number at a time Windows 10 Incrementing a style one number at a time Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,977
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

I like Charles' lateral thinking with a style change to include a paragraph number. That looks like a really good way to approach the question.

If you wanted the number to replace the %% then I would replace those with a Seq field and then update the fields to see these increment. To do this:
1. Create a field by typing the following line, selecting it and pressing Ctrl-F9
Seq styRunningNo
2. Select that field and Cut it by pressing Ctrl-X
3. Open the Replace dialog and replace all with the following settings
Find %%
Replace ^c
4. Update all fields
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a number style that incorporates heading number? SDwriter Word 4 10-29-2020 12:15 PM
Custom auto incrementing integer prefixes on headers ritmo2k Word 2 03-09-2018 06:39 AM
Auto Incrementing source for data validation OfficeTemp99 Excel 1 05-13-2015 06:36 AM
Incrementing a style one number at a time Help with incrementing Spinbutton value. dlowrey Excel Programming 3 11-24-2013 12:28 PM
Incrementing a style one number at a time multiply by incrementing by 5s marynomore Excel 2 03-27-2013 05:36 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:01 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft