A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
try this
Sub TrySelectShelf2_test()
'''''''''''''''select range based on cell value "Shelf 2"
On Error GoTo errh '<<< new line Dim nRow As Long
Dim nStart As Long, nEnd As Long
' Figure out where the "Shelf 2" data starts.
For nRow = 1 To 65536
If Range("D" & nRow).Value = "Shelf 2" Then
nStart = nRow
Exit For
End If
Next nRow
' Figure out where the "Shelf 2" data ends.
For nRow = nStart To 65536
If Range("D" & nRow).Value <> "Shelf 2" Then
nEnd = nRow
Exit For
End If
Next nRow
nEnd = nEnd - 1
Range("A" & nStart & ":G" & nEnd).Select
'End Sub
Call BorderLine
Exit Sub '<<< new lineerrh: '<<< new lineMsgBox "found nothing" '<<< new lineEnd Sub