Results 1 to 4 of 4

Find Last Row with data and enabled Sorting Macro

Threaded View

  1. #1
    Forum Contributor
    Join Date
    05-16-2011
    Location
    Philippines
    MS-Off Ver
    Excel 365/Excel 2016
    Posts
    315

    Find Last Row with data and enabled Sorting Macro

    Hi to all.Hoping you have a good day.I would like seek help or advices regarding my program. Please see attachment to visualize my problem.

    First I have 4 column A to D. that reviews all the tabs name in a workbook,it was reviewed based on their position. I would like to sort out the value of column A after the word "Template". I can record a macro and since my program is to review all tabs in a workbook my last tab was "Template" and If I unhide one tab "template" will be include in sorting.How can i determine the row "template" and after that I perform the sorting?

    Here is my recorded macro. In my sample file the Worksheet is "Sheet1",my original worksheet named Index.Thanks for the big help.

     ActiveWorkbook.Worksheets("Index").Sort.SortFields.Clear
            ActiveWorkbook.Worksheets("Index").Sort.SortFields.Add Key:=Range("A16"), _
            SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
            With ActiveWorkbook.Worksheets("Index").Sort
            .SetRange Range("A16:A100")
            .Header = xlNo
            .MatchCase = True
            .Orientation = xlTopToBottom
            .SortMethod = xlPinYin
           .Apply
         
          End With
    Attached Files Attached Files
    Last edited by emina002; 07-05-2011 at 06:00 AM. Reason: No attachment

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1