+ Reply to Thread
Results 1 to 7 of 7

VB Code to filter data

Hybrid View

rizmomin VB Code to filter data 05-30-2019, 04:59 PM
mjr veverka Re: VB Code to filter data 05-30-2019, 07:46 PM
rizmomin Re: VB Code to filter data 05-30-2019, 07:57 PM
mjr veverka Re: VB Code to filter data 05-30-2019, 08:14 PM
bakerman2 Re: VB Code to filter data 05-30-2019, 08:10 PM
rizmomin Re: VB Code to filter data 05-30-2019, 11:55 PM
bakerman2 Re: VB Code to filter data 05-31-2019, 01:06 AM
  1. #1
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    VB Code to filter data

    Hello:
    Please refer to attached file.
    I have data as shown in sheet1.
    I need VB code to filter these data by ascendng sort at A12.
    Once it is sorted then insert one row between each new
    I have manually done this in Sheet2.

    Let me know if you have any questions.
    Thanks.

    Riz
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,278

    Re: VB Code to filter data

    No more sorting keys, only this one - A12 ?

  3. #3
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: VB Code to filter data

    Hello Pv

    Please check the uploaded file and sheet2.
    Need to filter at A12 and do filter column A (FROM)

    Riz

  4. #4
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,278

    Re: VB Code to filter data

    Quote Originally Posted by rizmomin View Post
    ... check the uploaded file and sheet2
    I checked => "SKU" is not sorted and looks "ugly" ...

  5. #5
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,358

    Re: VB Code to filter data

    Try this.
    Sub tst()
        With Sheet1
            .Cells(12, 1).CurrentRegion.Offset(1).Sort .Range("A13"), xlAscending
            For i = .Range("A" & Rows.Count).End(xlUp).Row To 14 Step -1
                If .Cells(i, 1) <> .Cells(i - 1, 1) Then
                    .Cells(i, 1).EntireRow.Insert
                    .Cells(i, 1).Resize(, 6).Interior.Color = 14211288
                End If
            Next
        End With
    End Sub
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  6. #6
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: VB Code to filter data

    Hello Bakerman2:

    Thanks a lot, works great

    Riz

  7. #7
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,358

    Re: VB Code to filter data

    You're welcome and thanks for rep+.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. VBA code to filter data /3 criteria/
    By hharutyunyan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-26-2017, 03:28 PM
  2. [SOLVED] Code to filter Sub Array from data set
    By chullan88 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-04-2017, 02:41 AM
  3. Help Making Changes To Code To Filter More Data
    By artiststevens in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-23-2017, 04:30 AM
  4. [SOLVED] Code to filter and copy paste data
    By arun.sj in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-22-2015, 08:44 AM
  5. VBA code to filter data
    By Knigtandday in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-18-2013, 05:36 PM
  6. Code to Filter, Sum and return a value from data set
    By chiz in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-01-2008, 09:50 PM
  7. [SOLVED] VBA code to filter data
    By Pelham in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-18-2006, 12:30 AM

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