Question: Hey everyone, running into a bit of an issue,

I have created all my views through IB, with the main window having a NavigationController, and a TabBarController which loads a TableViewController in its first tab.

The problem happens when i use the searchbarcontroller in the navigation controller, everything works fine with the exception that when the navigation bar at the top disappears, the table expands too high, and i can't figure out what im doing wrong. 

Attached is an image of what im referring to, any help would be greatly appreciated.

[alt text http://img263.imageshack.us/img263/4706/picture1ot.png](http://img263.imageshack.us/img263/4706/picture1ot.png "Errorz")

Some more information:

i have my MainWindow with a UINavigationController, and a UITabBarController. On the first Tab, i have it loading another nib "AVN\_TableController" which is a UITableViewController nib, with the Searchbar delegate.

Answer: 
If you select multiple rows at once, the Selection property will return a Range object. Using this Range object you should be able to cut and paste the selected rows to the next worksheet and then delete them from the previous worksheet. 

I made a quick change to your code which I think should get you started on the right path:

```
Sub CutPasteRows()
 Dim iLastRow As Integer

 'Cut entire selection'
 Selection.Cut

 'if the active worksheet is the last one (no next worksheet), display error.'
  If ActiveSheet.Index = Worksheets.Count Then
   MsgBox ("There are no next worksheet")
  Else
    ActiveSheet.Next.Select
    iLastRow = ActiveSheet.UsedRange.Rows.Count

  'if the worksheet is blank, start with the first row. Otherwise, add 1 to the last row'
    If Cells(1, 1).Value = "" And iLastRow = 1 Then
        iLastRow = 1
    Else
        iLastRow = iLastRow + 1
    End If

    'Paste row'
    Rows(iLastRow).EntireRow.Select
    ActiveSheet.Paste

    'Go back to the last worksheet and delete selection'
    ActiveSheet.Previous.Select
    Selection.Delete
End If

```

[Selection property](http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel._application.selection.aspx)

[Range object](http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel.range%28office.11%29.aspx)
You just need to Union the Rows you need.

Like this:

```
Set workingRange = Application.Union(workingRange, newRange)

```

Of course, that means using range objects and not row numbers.