Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #8  
Old 12-06-2018, 07:19 AM
NoSparks NoSparks is offline Need help to add vba for Delete, Next and Previous command buttons Windows 7 64bit Need help to add vba for Delete, Next and Previous command buttons Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 842
NoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of light
Default

Quote:
Can you not sort the data to arrange it alphabetically?
You didn't bother to answer that question. Perhaps you're still thinking about it.

Every record can be added to the bottom of the table then sorted into its correct location.
Here's how the macro recorder handles the sort.
Code:
Sub Macro1()
'
' Macro1 Macro
' sort by last name
'

'
    Range("D2").Select
    ActiveWorkbook.Worksheets("DATA").ListObjects("tDATA").Sort.SortFields.Clear
    ActiveWorkbook.Worksheets("DATA").ListObjects("tDATA").Sort.SortFields.Add Key _
        :=Range("D2"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
        xlSortTextAsNumbers
    With ActiveWorkbook.Worksheets("DATA").ListObjects("tDATA").Sort
        .Header = xlYes
        .MatchCase = False
        .Orientation = xlTopToBottom
        .SortMethod = xlPinYin
        .Apply
    End With
End Sub
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Hiding Command Buttons before PDF ksigcajun Word VBA 3 05-07-2014 05:31 AM
Need help to add vba for Delete, Next and Previous command buttons Command buttons on slidemaster chcope PowerPoint 2 06-13-2013 04:30 PM
Command Buttons lorenambrose Word 0 10-06-2011 11:55 AM
command buttons ronf Excel 0 04-28-2006 08:32 AM
command buttons ronf Excel 0 12-03-2005 06:26 AM

Other Forums: Access Forums

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