Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 11-23-2023, 09:43 AM
Marrick13 Marrick13 is offline Sort Userform Labels Using Array Data Not Working Windows XP Sort Userform Labels Using Array Data Not Working Office 2010 32bit
Competent Performer
Sort Userform Labels Using Array Data Not Working
 
Join Date: Jun 2006
Posts: 102
Marrick13 will become famous soon enough
Default

This is part of an AutoText Tool I developed (as an adjunct to Word's autotext feature) that allows one to enter data in any of three lists and choose them to be written to the document. I recently added a toggle function whereby one can select ant two items from any of these lists and click a Toggle button. The macro would then alternate writing those selections to the document just by clicking that button.

However, the toggle is limited to the last two selections -- good if one wants only to alternate writing two pieces of text to a document (such as for a script or screenplay with only two character names to precede their dialog). But as I wanted to be able to click a button to write up to ten pieces of text (or character names) without having to select them from any of the listboxes, I hit upon the idea of setting up a separate form with the ten labels you see, and an Edit and Delete command for each. The idea was to allow one to click an Edit button, which would open an input box, type or paste in the text, and do this for however many pieces of text he wants to have so he can just click the button and the application would write its caption to the document. But I wanted to be able to sort those labels alphabetically (to make the text easier to find while typing and clicking the buttons), and thought that the only way to do that was to put the captions in an array, sort the array, and then have the application apply the ordered captions to the labels (instead of actually moving the labels, which was my first thought). I thought that the alphabetical sorting function would be the hardest to achieve, and I was right. But I do not want a listbox because I already have that in the main application (the three listboxes); for this, I wanted to be able to write up to ten pieces of text to the document by just clicking a button. Imagine a script or interview where one has to repeat several speaker names in a document. If there are more than two, the toggle won't be adequate for this, and having to find and select them from a listbox adds mouse action and time. But if I want to be able to choose from among up to ten pieces of text and continually repeat those pieces of text by just clicking a button, this is what I came up with.

The multiclickwrite form I shared on the forum is only part of this AutoText Tool and I wanted to get it working separately before adding it to the main application.
Reply With Quote
 

Tags
array, word vba



Similar Threads
Thread Thread Starter Forum Replies Last Post
Sort Userform Labels Using Array Data Not Working VBA help non breaking spaces for array of words not working correctly Shelley Lou Word VBA 2 03-08-2023 03:15 AM
Sort option is not working Francois-Spain Excel 1 07-04-2019 02:01 AM
Sort Userform Labels Using Array Data Not Working Sort option is not working Francois-Spain Excel 7 06-27-2019 11:04 AM
Sort Userform Labels Using Array Data Not Working How do I make a checkbox or dropdown item reference data in that specific section of the data array? dhare Excel Programming 2 02-24-2016 12:36 PM
Powerpoint: adding data to trend lines w/o data labels HaiLe PowerPoint 0 04-11-2011 09:21 AM

Other Forums: Access Forums

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


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