Macro to scrol to a name in a cell but with screen slit using freeze panes

tonywatsonhelp

Well-known Member
Joined
Feb 24, 2014
Messages
3,210
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
Hi Everyone,

Hope someone can help me.

I want to be able the have a macro scroll the page to a name.

Now heres my page set up

Columns A to H are fixed using freeze Panes,

I onwards are the columns with names in,

The name I want to scroll to is in cell B5 (as in this is where the name is stored to look for)

the names are listed in row 8

So I need a macro that can look at the name in cell B5, go along Columns I to CA
find a matching name and scroll that column so it sits next to my frozen cells, so next to H.

can someone help me do this please?

Thanks

Tony
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Hi, you could try something like this:

Code:
Sub M()
Dim r As Range
Set r = Rows("8").Find(What:=Range("B5").Value, LookIn:=xlValues, LookAt:=xlWhole)
If Not r Is Nothing Then Application.Goto r, True
End Sub
 
Upvote 0
Great, good to hear :)

I did miss one the parameters though, I think you should include the red section, set to TRUE if appropriate.

Rich (BB code):
Sub M()
Dim r As Range
Set r = Rows("8").Find(What:=Range("B5").Value, LookIn:=xlValues, LookAt:=xlWhole, MatchCase:=False)
If Not r Is Nothing Then Application.Goto r, True
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top