View Single Post
Old 06-22-2011, 10:56 AM   #1
anhui9435
 
Posts: n/a
Default Office Home And Business 2010 Key Daily Dose of Ex

Every day Dose of Excel ,Windows 7 Starter Key HP Laptop Battery, Laptop Battery for HP
Daily posts of Excel tips…and other stuff
Sub SelectAdjacentCol()

Dim rAdjacent As Range

If TypeName(Selection) = "Range" Then
If Selection.Column > 1 Then
If Selection.Cells.Count = 1 Then
If Not IsEmpty(Selection.Offset(0, -1).Value) Then
With Selection.Offset(0,Office Home And Business 2010 Key, -1)
Set rAdjacent = .Parent.Range(.Cells(1), .End(xlDown))
End With

Selection.Resize(rAdjacent.Cells.Count).Select
End If
End If
End If
End If

End Sub
  Reply With Quote

Sponsored Links