Hi David ,
The Selection property returns the selected cells ; so :
[pre]
Code:
Selection.EntireRow.Select
will select the entire row , and :
[pre][code]Selection.EntireRow.Copy
[/pre]
will copy the entire row.
If you don't want to select the entire row , then the following procedure will do the job ; you can modify it as required.
Public Sub Multiple_Select()
Dim copy_range As Range, new_range As Range, cell As Range
Dim i As Long, number_of_rows As Long, min_row As Long, max_row As Long
Dim min_col As Integer, max_col As Integer
number_of_rows = 0
min_row = Rows.Count: max_row = 0: min_col = Columns.Count: max_col = 0
For Each cell In Selection
With cell
If min_row > .Row Then min_row = .Row
If max_row < .Row Then max_row = .Row
If min_col > .Column Then min_col = .Column
If max_col < .Column Then max_col = .Column
End With
Next
Set new_range = Range(Cells(min_row, min_col), Cells(max_row, max_col))
For i = 1 To max_row - min_row + 1
If Not (Application.Intersect(Selection, new_range.Rows(i)) Is Nothing) Then
If copy_range Is Nothing Then
Set copy_range = new_range.Rows(i)
Else
Set copy_range = Union(copy_range, new_range.Rows(i))
End If
End If
Next
copy_range.Select
End Sub[/code][/pre]
Narayan