Move a row to the centre of my sheet Excel 2002

  • Thread starter Thread starter Paul
  • Start date Start date
P

Paul

Hello All
I would like to run an excel spreadsheet maximized. Search for a cell with
data that meets certain criteria. When a match is found move the row that
the cell is in to the middle of my sheet. I have the search done,but I
haven't figured out how to centre the row.
Any help would be much appreciated,
Paul
 
As always, you should copy/paste your coding efforts here. Do NOT attach a
workbook.
 
Sub AAA()
Dim rng As Range, numRows As Long
Set rng = Cells.Find("ABCD")
rng.Select
numRows = Int(ActiveWindow.VisibleRange.Rows.Count / 2)
If rng.Row > numRows Then
ActiveWindow.ScrollRow = rng.Row - numRows
Else
ActiveWindow.ScrollRow = 1
End If
End Sub
 
Back
Top