+ Reply to Thread
Results 1 to 3 of 3

Macro select all but last row

  1. #1
    Registered User
    Join Date
    11-09-2011
    Location
    Cali
    MS-Off Ver
    Excel 2010
    Posts
    9

    Macro select all but last row

    I attached a file with raw data and my desired results.
    Here is the macro I am using but it doesnt work when there are different number of transactions
    Sub SplitDate()
    '
    ' SplitDate Macro
    '

    '
    Range("A2").Select
    Range(Selection, Selection.End(xlDown)).Select
    Range("A2:A45").Select
    Selection.TextToColumns Destination:=Range("G2"), DataType:=xlFixedWidth, _
    FieldInfo:=Array(Array(0, 1), Array(10, 1)), TrailingMinusNumbers:=True
    Range("A2:H45").Select
    ActiveWindow.SmallScroll Down:=18
    Selection.Copy
    End Sub
    How do I make the macro work when there are a different number of lines of transactions(in this example there are 45, other moths there are more or less)?
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Macro select all but last row

    Please Login or Register  to view this content.
    If solved remember to mark Thread as solved

  3. #3
    Registered User
    Join Date
    11-09-2011
    Location
    Cali
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Macro select all but last row

    works. Thanks

+ Reply to Thread

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