Gossamer Forum
Home : General : Internet Technologies :

Excel Macro

Quote Reply
Excel Macro
Hi,
The following code is suppose to re-arrange rows of excel speadsheet data into columns.
Could someone explain what it does line by line?
I want to be able to modify it to suit my needs but I have no idea where to start.
Is it VB?


Public Sub AddressSort()
last = ActiveSheet.UsedRange.Row - 1 + _
ActiveSheet.UsedRange.Rows.Count
With Worksheets(1)
For x = last To 2 Step -1
If .Cells(x, 1).Value <> "" And _
.Cells(x - 1, 1).Value <> "" And _
.Cells(x - 1, 2).Value = "" Then
.Range(.Cells(x, 1), .Cells(x, 10)).Copy Destination:=.Range(.Cells(x - 1, 2), .Cells(x - 1, 2))
.Rows(x).Delete
End If
Next x
.Range("A:A").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
End With
End Sub

Pehaps someone could also reccommend a good (Basic) book that explains how to make excel macros?
Thank you.