Move a row to the centre of my sheet Excel 2002

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
 
D

Don Guillett

As always, you should copy/paste your coding efforts here. Do NOT attach a
workbook.
 
T

Tom Ogilvy

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top