Hi,
How could I make the following code to loop through the selected rows.
Any help would be appreciated.
[vba]Sub CopyMe()
Dim myrow As Long
Dim wsh As Worksheet
Dim rng As Range
Dim r As Long
myrow = ActiveWindow.RangeSelection.Row
Set wsh = Worksheets("MySheet")
Set rng = wsh.Range("B:B").Find(What:=Range("O6").Value, LookIn:=xlValues, LookAt:=xlWhole)
If rng Is Nothing Then
r = wsh.Range("B" & wsh.Rows.Count).End(xlUp).Row + 1
Else
rng.Offset(1, 0).EntireRow.Insert
r = rng.Row + 1
End If
ActiveSheet.Range("F" & myrow & ":I" & myrow).Copy Destination:=Worksheets("MySheet").Range("C" & r)
ActiveSheet.Range("O6").Copy Destination:=Worksheets("MySheet").Range("B" & r)
Application.CutCopyMode = False
End Sub[/vba]