Results 1 to 4 of 4
  1. #1
    DMT Dave is offline VIP
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    1,185

    Arranging Excel Column

    Hi Guy's I can't seem to get this one right!!!



    I am trying arrange column E2 to intLastRow Ascending

    What is the best method please ?

    This is the row i am trying to sort A-Z Ascending so the OrgQty (Original Qty) is from Row2 to intLastRow

    The OrgQty Column looks like this
    Qty (20) 10-06-22

    Code:
        With xlWB    .Worksheets(1).Cells(intLR + 1, 1) = Me.StartQty
        .Worksheets(1).Cells(intLR + 1, 2) = Me.LiftType
        .Worksheets(1).Cells(intLR + 1, 3) = Me.LiftNo
        .Worksheets(1).Cells(intLR + 1, 4) = Me.PONumber
        .Worksheets(1).Cells(intLR + 1, 5) = Me.OrgQty
                          TRIED ADDING THIS LINE BUT NO GO!!! .Worksheets(1).Range("E2:" & intLR).Sort Key1:=Range("E5"), Order1:=xlAscending, Header:=xlNo
        .Worksheets(1).Cells.EntireColumn.HorizontalAlignment = xlLeft

  2. #2
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,001
    What error are you getting?
    What is intLR? I suspect it's a last row number.

    if it is this statement isn't a valid range
    .Range("E2:" & intLR)
    It should be
    .Range("E2:E" & intLR)
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  3. #3
    DMT Dave is offline VIP
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    1,185
    Ahhh Minty, yes sorry i missed that, yes it is last row

    I forgot to add the column of E in the latter part so it knows column and row count

    I haven't had a chance to come back to this but yes, i am trying arrange column E from row 2 to end row ascending

  4. #4
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,861
    It is excel, record the macro of the steps, then view and amend to suit.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Report sorting / arranging order
    By aligahk06 in forum Reports
    Replies: 1
    Last Post: 09-16-2020, 08:47 AM
  2. Arranging a dependent field in a form
    By Bradex in forum Forms
    Replies: 7
    Last Post: 03-18-2016, 05:28 PM
  3. Arranging Data and Logic
    By IAFerrari in forum Forms
    Replies: 1
    Last Post: 10-20-2015, 08:23 AM
  4. Replies: 12
    Last Post: 10-08-2014, 02:35 PM
  5. Excel Query data re-arranging.
    By tc197 in forum Queries
    Replies: 2
    Last Post: 08-20-2014, 07:59 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums