I have been looking in this forum for an answer to help me position a
specific row located by a macro at the top of the screen. Can someone
help?
Thank's ahead
Jim Cone - 22 Mar 2008 23:11 GMT
From the Excel Vba help file...
This example moves row ten to the top of the window.
Worksheets("Sheet1").Activate
ActiveWindow.ScrollRow = 10

Signature
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)
"Bobby"
wrote in message
I have been looking in this forum for an answer to help me position a
specific row located by a macro at the top of the screen. Can someone
help?
Thank's ahead
Barb Reinhardt - 22 Mar 2008 23:13 GMT
Try something like this
Dim myOldRange As Range
Dim myNewRange As Range
'
Set myOldRange = ActiveCell
Set myNewRange = Range("a100")
ActiveWindow.SmallScroll Down:=myNewRange.Row - myOldRange.Row
ActiveWindow.SmallScroll toLeft:=myNewRange.Column - myOldRange.Column
I don't think it does what you want YET, but you can play with it.

Signature
HTH,
Barb Reinhardt
> I have been looking in this forum for an answer to help me position a
> specific row located by a macro at the top of the screen. Can someone
> help?
> Thank's ahead
Gord Dibben - 22 Mar 2008 23:20 GMT
Which "specific" row would you be referring to?
A user-selected row or a row with a particular value?
How would the macro locate the row?
Do you have a macro? Post the code.
Here is a simple macro that copies a selected row or rows to row 1
Sub copy_row()
Selection.Copy Destination:= _
ActiveSheet.Range("A1")
End Sub
No warning, just overwrites.
Gord Dibben MS Excel MVP
>I have been looking in this forum for an answer to help me position a
>specific row located by a macro at the top of the screen. Can someone
>help?
>Thank's ahead
Bobby - 22 Mar 2008 23:39 GMT
> Which "specific" row would you be referring to?
>
[quoted text clipped - 21 lines]
>
> - Show quoted text -
Hi Gord!
What I do is I locate the current month in a specific column starting
from the top of the file. Whwn I get a hit I would like to put that
specific row on top. Here is the code:
Range("E:E").Select
mois = Split("bidon jan fév mar avr mai jun jul aoû sep oct nov déc",
" ")
findvar = mois(Month(Date))
With ActiveSheet.Range("E:E") ' SUPER SEARCH...!
Set c = .Find(findvar, LookIn:=xlValues)
If c Is Nothing Then Exit Sub 'Pas trouvé!
End With
Range("A" & c.Row & ":" & "A" & c.Row).Select
Gord Dibben - 23 Mar 2008 00:05 GMT
I think maybe I mis-interpreted your needs.
Do you want that row scrolled to the top as Jim has suggested?
He might have interpreted "position" better than I did.
Otherwise, add this line to your code
Selection.Copy Destination:= _
ActiveSheet.Range("A1")
Gord
>Hi Gord!
>What I do is I locate the current month in a specific column starting
[quoted text clipped - 11 lines]
>
>Range("A" & c.Row & ":" & "A" & c.Row).Select
Bobby - 23 Mar 2008 03:24 GMT
> I think maybe I mis-interpreted your needs.
>
[quoted text clipped - 26 lines]
>
> - Show quoted text -
Yes, I want that row scrolled to the top.
Thank's for your time.
Gord Dibben - 23 Mar 2008 04:27 GMT
Jim's reply shows the code required.
Thanks for the update.
Gord
>> I think maybe I mis-interpreted your needs.
>>
[quoted text clipped - 29 lines]
>Yes, I want that row scrolled to the top.
>Thank's for your time.