You would need to make changes to all of the routine, BotLeft, BotRight, etc., as well.Originally Posted by xluser2007
That should beOriginally Posted by xluser2007
[vba]
Set r = Rng(Selection, 1)
x = r.Cells.Count
Set r = r.Cells(x, 1)[/vba]
Try moving the toolbar build code to Workbook_Open.Originally Posted by xluser2007
[vba]Originally Posted by xluser2007
Function Rng(Sel As Range, Direct As Long) As Range
x = 0: y = 0: z = 0
cls = Sel.Cells.Count
If Sel.Rows.Count > 1 Then
Set Rng = Sel.Columns(1)
Else
If Direct = -1 Then
If Sel.Cells(1, 1).Row - cls < 1 Then cls = Sel.Cells(1, 1).Row
Set Rng = Sel.Cells(1, 1).Offset(1 - cls).Resize(cls)
Else
Set Rng = Sel.Cells(1, 1).Resize(cls)
End If
End If
End Function[/vba]