The purpose of this code is to easily sort data – then hide/unhide rows – next I assign a product code (using treeview keys – so I can have as many relationships as I want – emulating a relational database – Next I can query product codes – that way I can find say all 6 cylinder cars of the brand Ford or the brand Chevy or both and so on – all depends on my treeview key – Anyway this code don’t show the treeview).
The code allow you to select entire rows on the sheet directly using Shift+Mouse_Click or Ctrl+Mouse_click – there is a hidden userform that that will track your selection if the range exceeds 254 characters – dam 255 number in Excel. So simply select rows using the mouse – on the visible userform use the ‘Add’ to assign a True value or ‘Remove’ to assign a False value for the highlighted rows in the column ‘Selected’. You may also toggle the True/False value by a simple click on a cell in the Selected Column – again these changes are trapped by the hidden form. This also allow you to load other forms and simply get the selections from the hidden form. This feature has only real value if you have > 10K rows or something like that in your sheet.
After you made your selection you can checkmark the selected records-any records with the value false can now be hidden – ‘Hide by checking box’ and UnHidden by unchecking box.
You can click on the header column to sort by that value – just like an explorer bar option – unfortunately to toggle between ascending/descending – you have to click cell above or below the header – then click the header again – I cannot figure out how to trigger event without pulsing the value. The purpose of the Position column is simply to allow the data to be sorted in order of entry.
If anybody has suggestions or similar routines I would be very appreciative. I have been using VB6 for years – but is new to all the XL functions. So just finding my way around in coding in XL.
Bookmarks