Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-01-2020, 06:57 AM
BobBridges's Avatar
BobBridges BobBridges is offline How to write a VBA subroutine one of whose arguments specifies WHICH PROPERTY to use in a loop Windows 7 64bit How to write a VBA subroutine one of whose arguments specifies WHICH PROPERTY to use in a loop Office 2010 32bit
Expert
How to write a VBA subroutine one of whose arguments specifies WHICH PROPERTY to use in a loop
 
Join Date: May 2013
Location: USA
Posts: 700
BobBridges has a spectacular aura aboutBobBridges has a spectacular aura about
Default How to write a VBA subroutine one of whose arguments specifies WHICH PROPERTY to use in a loop

I'm writing a medium-complex set of Excel reports that requires sorting various collections. In each case I want to sort a collection based on a different property, but the logic is the same aside from that. So it's time to think about a subroutine that'll do the job.

But is it possible? For instance, in one case I want to sort a collection of User objects based on the LFName property; in another I'm sorting a collection of Xct objects on the Name property. I know a third such case is coming up where I want to sort a collection of objects based on a different property yet again.

So I want to write a subroutine that sorts the specified collection on the specified property. I'm not asking about how to do the sort; I'm already doing that. But is it possible for the caller to specify a different property (not a particular value) in each call? I've a notion I've seen something like that, long ago, but at the time I no doubt shrugged and thought it was too exotic for me to expect to need.


Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Pass Arguments to Function Through Ribbon inagalaxyfarfarawry Word VBA 11 03-25-2022 09:28 PM
Where to put Subroutine to make sure bookmarks aren't deleted so cross-references work mrsjetset Word VBA 5 06-29-2016 05:06 PM
How to write a VBA subroutine one of whose arguments specifies WHICH PROPERTY to use in a loop Function or subroutine with counting memory paik1002 Word VBA 1 12-15-2015 01:28 AM
How to write a VBA subroutine one of whose arguments specifies WHICH PROPERTY to use in a loop How to Pass Arguments in a Formula? tinfanide Excel Programming 2 10-13-2014 06:10 AM
write need help and copy write need help on another page auto wykoems Word 2 07-25-2013 07:56 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:27 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