Results 1 to 13 of 13

my VBA code needs an adjustment

Threaded View

  1. #2
    Registered User
    Join Date
    09-05-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: my VBA code needs an adjustment

    sorry - this is the correct code

    Sub ToColumns()
    Dim Area As Range
    Dim LastRow As Long, i As Long, aArea As Range
    On Error Resume Next
    Columns("B").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
    On Error GoTo 0
    LastRow = Cells(Rows.Count, "A").End(xlUp).Row
    For i = LastRow To 2 Step -1
        If Range("A" & i).Value <> Range("A" & i - 1).Value Then
            Rows(i).Insert
        End If
    Next i
    For Each Area In Columns("B").SpecialCells(xlCellTypeConstants).Areas
        Area(1).Offset(, 1).Resize(, Area.Rows.Count).Value = Application.Transpose(Area)
    Next Area
    Columns("C").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
    Columns("B").Delete
    End Sub
    Last edited by arlu1201; 09-05-2012 at 10:47 AM.

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