-
WSCPD-CB
AskWoody Loungerwhat i am after, is that if I filter on a date range, eg February, then I would like to know how many nights were billable, non-billable, and billable special.
-
WSCPD-CB
AskWoody LoungerPaul,
WIth my understanding of word that sounds great. I am however having trouble implementing the solution. I now realise that I probably have not given sufficient information how the solution, in my mind, would work. After writing the paragraph, or document, I would go through the document and identify the ‘Recommendation’, highlight the ‘recommendation’ text that I want duplicated in summary section and then hit a ‘whiz bang macro button’ which will produce the magic that will enable the cross referencing in the summary section.
Below is an example of a macro that was generated to do a similar function for abbreviations in the report …. but I dont have the talent to modify it and ideally i would like this functionality for a report I am writing overnight. I dont mind a SEC field or a bookmarking function….I am easily pleased 🙂 Once again, apologies for my lack of macro karma.
Code:Public Sub MakeREC() Debug.Print Now(), "CompanyGlobal.MakeABR" On Error GoTo MakeABR_Err: Dim rngThis As Range, rngE As Range, rngA As Range Dim lStart As Long, lEnd As Long, ret As Long Dim bmNum As Long Dim strText As String, strMsg As String, strTitle As String, strParen As String Dim bmAName As String, bmEName As String Dim bmA As Bookmark, bmE As Bookmark, bmThis As Bookmark ' Routine to make bookmarks for the abbreviation list ' takes a selection including the full text followed by the abbreviation in parentheses ' extracts the text before the parentheses and marks that with the next available eNN bookmark ' then marks the text in the partenthese with the corresponding aNN bookmark. Set rngThis = Selection.Range 'First check that there are no bookmarks already in the selection If rngThis.Bookmarks.Count > 1 Then 'There are already bookmarks in here - check if they are to be kept, replaced or quit strMsg = "There are already bookmark(s) in the selection:" & vbCr & _ rngThis.Text & vbCr & _ "Do you want to add more?" & vbCr & _ "Choose Yes to Keep the bookmarks and add new ones for this Explanation and Abbr." & vbCr & _ "Choose No to Replace the bookmarks with new ones for this Explanation and Abbr." & vbCr & _ "Choose Cancel to quit." strTitle = "Abbreviation Capture" ret = MsgBox(strMsg, vbDefaultButton1 + vbYesNoCancel, strTitle) Select Case ret Case vbYes 'Do Nothing Case vbNo For Each bmThis In rngThis.Bookmarks bmThis.Delete Next bmThis Case vbCancel Exit Sub End Select End If 'check for parentheses strText = rngThis.Text strParen = "(" lStart = InStr(strText, strParen) strParen = ")" lEnd = InStr(strText, strParen) Debug.Print strText, lStart, lEnd If lStart > 0 And lEnd > 0 Then 'We have found the abbr 'Find the next available bookmark number bmNum = 1 'Make the BM names bmAName = "a" & Trim(Format(bmNum, "00000")) bmEName = "e" & Trim(Format(bmNum, "00000")) While ActiveDocument.Bookmarks.Exists(bmAName) Or ActiveDocument.Bookmarks.Exists(bmEName) bmNum = bmNum + 1 bmAName = "a" & Trim(Format(bmNum, "00000")) bmEName = "e" & Trim(Format(bmNum, "00000")) Wend 'make the ranges If lStart > 1 Then 'The parentheses are not at the start of the line - assume explanation is Set rngE = ActiveDocument.Range(Start:=rngThis.Start, End:=rngThis.Start + lStart - 1) Set rngA = ActiveDocument.Range(Start:=rngThis.Start + lStart, End:=rngThis.Start + lEnd - 1) Else 'The parentheses are at the start of the line so make this the abbr Set rngA = ActiveDocument.Range(Start:=rngThis.Start + lStart, End:=rngThis.Start + lEnd - 1) Set rngE = ActiveDocument.Range(Start:=rngThis.Start + lEnd, End:=rngThis.End) End If 'Add the bookmarks Set bmE = ActiveDocument.Bookmarks.Add(bmEName, rngE) Set bmA = ActiveDocument.Bookmarks.Add(bmAName, rngA) Else 'No opening and closing paren - so message strMsg = "There is no set of parentheses () in the the selection." & vbCr & _ "Please make a selection including the full text, and the abbr in parentheses()" strTitle = "Abbreviation Capture" MsgBox strMsg, vbOKOnly, strTitle Exit Sub End If Exit Sub MakeABR_Err: Debug.Print "MakeABR_Err:", Err.Number, Err.Description, Err.Source Resume Next End Sub
-
WSCPD-CB
AskWoody LoungerHi Paul,
Thanks for your review. The reports that I generate follow a rather strict format style (called a seven part paragraph) so the conclusion and recommendation are inbedded in the ‘one paragraph’ with the other ‘5 parts’. So I understand your proposed solution, and I would even know how to do that myself :rolleyes:, but it not applicable for my particular problem.
Cheers
Claude
-
WSCPD-CB
AskWoody LoungerYou can add a category to the already assigned categories as follows:
Code:If collSelItems(lngC).Categories = "" Then collSelItems(lngC).Categories = "my category" Else collSelItems(lngC).Categories = collSelItems(lngC).Categories & ", my category" End If
Hi Hans,
See the code below…I hope I have interpreted your instructions correctly? Unfortunately, I get an ‘run time 9 , subscript out of range’ error when I try to run the macro:
Sub SetCategoryP0429()
Dim collSelItems As Collection
Dim lngC As Long
Set collSelItems = GetSelectedItems
If collSelItems(lngC).Categories = “” Then
collSelItems(lngC).Categories = “P0429”
Else
collSelItems(lngC).Categories = collSelItems(lngC).Categories & “, P0429”
End IfSet collSelItems = Nothing
End SubCan you advise how to fix this?
Cheers,
Claude
-
WSCPD-CB
AskWoody LoungerYou can specify multiple category as a list separated by comma+space:
collSelItems(lngC).Categories = “category-topic, category-file”
Hi Hans, Thanks for your answer. I was wondering if there is a method of ‘adding’ to a previously assigned category rather than doing multiple categories as you have presented above. Apologies if I wasn’t clear in my earlier request.
Thanks – Claude
-
WSCPD-CB
AskWoody LoungerSet up a workbook exactly the way you want all new workbooks to look.
Save it as an Excel template named Book.xlt (this name is obligatory) in your Excel start folder, usually C:Documents and SettingsApplication DataMicrosoftExcelXLSTART. This template will be used for new workbooks if you do not explicitely create it from another template.
Then delete all sheets except one, and save as an Excel template named Sheet.xlt in the same folder. Again, the name is obligatory.
This template will be used when you select Insert | Worksheet.Thanks Hans – thats great info
-
WSCPD-CB
AskWoody LoungerYou can select a range of cells or even a whole sheet, and tick the Wrap Text check box in the Alignment tab of Format | Cells…
Another option is to turn on Wrap Text in the Normal style – the style that is applied to all cells by default until the user selects another style.Hi Hans,
excuse my ignorance, but how can you set your normal style for all new workbooks, ie as you can for normal.dot in word?
-
WSCPD-CB
AskWoody LoungerHi I have been trying to solve the same problem – getting a year view that I could plot on a large A1 plotter. Anyway, a couple years back I got a trial third party add-in from Planet Software Pty Ltd (Adelaide Australia) but I couldn’t get it to work after an hour or so, so gave up (I am not an IT superstar…so it could just be me or my computer configuration).
2005 contact details
Planet Software Pty Ltd
Phone: +61 8 8267 6199
Mobile: 0418 693 284
mailto:gsmith@planetsoftware.com.auAnyway, do a search for planet software in Australia and you may have better luck – let me know how it goes.
Cheers,
Claude
-
WSCPD-CB
AskWoody LoungerApril 27, 2008 at 8:07 am in reply to: Removing ‘shortcut’ tags on explorer shortcuts (Windows XP) #1107001Hi Alan, thanks for taking the time to respond to me. The rename utility look good, but I did not install it due to the warning (on the same site) that the program cannot be fully removed??? Thanks again.
-
WSCPD-CB
AskWoody LoungerApril 27, 2008 at 8:05 am in reply to: Removing ‘shortcut’ tags on explorer shortcuts (Windows XP) #1107000Thanks Batcher, copied the file and it worked well. I will use this at one of my work sites where they dont let me install programs on the system, ie tweak. THanks again
-
WSCPD-CB
AskWoody LoungerApril 27, 2008 at 2:28 am in reply to: Removing ‘shortcut’ tags on explorer shortcuts (Windows XP) #1106993Thanks – this worked a treat and I found some other useful tools.
-
WSCPD-CB
AskWoody LoungerThanks all for helping me out. The code now works, however I am a little confused what the code adds. I tried selecting multiple items in the explorer pane to see if set categories to multiple items (ie what I understood from John’s “…of all selected items in explorer pane..”) but it still only adjusted one email item. To my understanding, this is the same function as the previous code.
I am interested to understand what the code does/add when you have time, and helped out a few other people with potentially higher priority problems…..
Thanks again.
-
WSCPD-CB
AskWoody LoungerEdited by HansV to crop huge screenshot to show only the relevant part
Thanks John, the code sound intriguing (for someone who likes tools but does not understand VBA!). I tried to establish a test case but came up with an error (refer to attached).
Can you please give me any hints on how I may have incorporated it incorrectly. Thanks
-
WSCPD-CB
AskWoody LoungerHans – the advice that I have to have the email ‘open’ was the trick – thankyou. Do you know if there is a way to assign categories without having the mail item actually open, ie assigning a category when you have the mail item highlighted and are reading it in the preview pane?
Once again thanks for the fast response.
-
WSCPD-CB
AskWoody LoungerHans,
FOr some reason the Macro’s dont work anymore. I am a bit confiused because I am sure they worked initially. When I first try to use the macro after logging on outlook asks if I want to ‘enable macros’ which I say ‘yes’. Even, the open categories dialogue box does not open anymore?? I have attached a couple of the macros which I am sure replicate those that you recommended. Any ideas on the problem? Thanks.
Sub SetCategoryIAC()
If Inspectors.Count > 0 Then
ActiveInspector.CurrentItem.Categories = “IAC”
End If
End SubSub ShowCategoriesDialog()
If Inspectors.Count Then
With ActiveInspector.CurrentItem
If .Class = olMail Then .ShowCategoriesDialog
End With
End If
End Sub
![]() |
Patch reliability is unclear, but widespread attacks make patching prudent. Go ahead and patch, but watch out for potential problems. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |

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
-
Windows 10 filehistory including onedrive folder
by
Steve Bondy
58 minutes ago -
pages print on restart (Win 11 23H2)
by
cyraxote
14 minutes ago -
Windows 11 Insider Preview build 26200.5581 released to DEV
by
joep517
3 hours, 10 minutes ago -
Windows 11 Insider Preview build 26120.3950 (24H2) released to BETA
by
joep517
3 hours, 11 minutes ago -
Proton to drop prices after ruling against “Apple tax”
by
Cybertooth
10 hours, 32 minutes ago -
24H2 Installer – don’t see Option for non destructive install
by
JP
15 minutes ago -
Asking Again here (New User and Fast change only backups)
by
thymej
21 hours, 53 minutes ago -
How much I spent on the Mac mini
by
Will Fastie
25 minutes ago -
How to get rid of Copilot in Microsoft 365
by
Lance Whitney
3 hours, 48 minutes ago -
Spring cleanup — 2025
by
Deanna McElveen
1 day, 3 hours ago -
Setting up Windows 11
by
Susan Bradley
6 hours, 8 minutes ago -
VLC Introduces Cutting-Edge AI Subtitling and Translation Capabilities
by
Alex5723
23 hours, 13 minutes ago -
Powershell version?
by
CWBillow
1 day ago -
SendTom Toys
by
CWBillow
8 hours, 22 minutes ago -
Add shortcut to taskbar?
by
CWBillow
1 day, 4 hours ago -
Sycophancy in GPT-4o: What happened
by
Alex5723
1 day, 20 hours ago -
How can I install Skype on Windows 7?
by
Help
1 day, 19 hours ago -
Logitech MK850 Keyboard issues
by
Rush2112
1 day, 2 hours ago -
We live in a simulation
by
Alex5723
2 days, 10 hours ago -
Netplwiz not working
by
RetiredGeek
1 day, 21 hours ago -
Windows 11 24H2 is broadly available
by
Alex5723
2 days, 22 hours ago -
Microsoft is killing Authenticator
by
Alex5723
48 minutes ago -
Downloads folder location
by
CWBillow
3 days, 5 hours ago -
Remove a User from Login screen
by
CWBillow
2 days, 1 hour ago -
TikTok fined €530 million for sending European user data to China
by
Nibbled To Death By Ducks
2 days, 20 hours ago -
Microsoft Speech Recognition Service Error Code 1002
by
stanhutchings
2 days, 20 hours ago -
Is it a bug or is it expected?
by
Susan Bradley
22 hours, 40 minutes ago -
Image for Windows TBwinRE image not enough space on target location
by
bobolink
2 days, 19 hours ago -
Start menu jump lists for some apps might not work as expected on Windows 10
by
Susan Bradley
1 day, 19 hours ago -
Malicious Go Modules disk-wiping malware
by
Alex5723
3 days, 9 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.