Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 10-01-2013, 04:37 PM
macropod's Avatar
macropod macropod is offline VBA sort table code Windows 7 32bit VBA sort table code Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,521
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by mikec View Post
I have attached POY REV 14b.xlsm. The code under discussion is in the Diaries form. It is fired by the Save command on the first page of the form. A call to Private Sub SortCompetition from the save command code prompts the sort of the table. This sub is in General section of the form code. Immediately below are subs I have renamed as SortCompetition1 and Sort Competitions. The former has the Key definition that does not run. The latter is the original code. As general background I am going through this project with the intention of removing direct cell references and range selection wherever I can. Why? Well it's fun!
Thank you for your interest - this one is driving me crazy
Hi Mike,

The answer is quite simple:
.ListColumns(1) returns the string 'Date', not its cell range.
What you need is something like:
.ListColumns(1).Range.Cells(1, 1)
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 

Tags
range, sort, vba



Similar Threads
Thread Thread Starter Forum Replies Last Post
Outlook Combobox Sort Code lms Outlook 1 09-18-2013 09:56 AM
VBA sort table code How to Sort Table Cells from Left to Right tamaracklodge Word Tables 4 03-04-2013 04:00 AM
Sort table using macro saslotteroy Word VBA 2 09-15-2011 02:41 PM
VBA sort table code How to sort table having three columns? Bahir Barak Word 2 01-20-2011 01:52 PM
Can I sort a Pivot table by subtotals? oshkosh Excel 1 12-07-2010 06:20 PM

Other Forums: Access Forums

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