rjplante
Well-known Member
- Joined
- Oct 31, 2008
- Messages
- 574
- Office Version
- 365
- Platform
- Windows
I have created a macro to scroll to the row that begins with the letter selected. I had this working great before lunch. I copied the macro and the activeX field over to another workbook. Now the part where it scroll to the selected letter row does not work. If the search cell is blank, it will scroll to the home row just fine. What is going on? Why won't the GoRow portion work any more?
Thanks for the help.
Robert
Thanks for the help.
Robert
Code:
Dim GoRow As Long
Dim HomeRow As Long
Application.ScreenUpdating = False
Sheets("All Agreements").Unprotect
GoRow = ActiveWorkbook.Sheets("All Agreements").Range("E8:E1000000").Find(Sheets("All Agreements").Range("AJ1").Value & "*", , , , , , False).Row
HomeRow = Sheets("All Agreements").Range("E8").Row
' Scroll to row of selected letter
If Sheets("All Agreements").Range("AJ1").Value = "" Then
With ActiveWindow
.ScrollRow = HomeRow
End With
Else
With ActiveWindow
.ScrollRow = GoRow
End With
End If
With Sheet1
.ComboBox2.ListIndex = -1
End With