Button with macro, based on input in dropdown

Junior19

New Member
Joined
Nov 23, 2007
Messages
6
I'm currently working on a schedule, with 52 weeks.
In order to make it easier to move around in the schedule I've tried different methods, one week on separate sheets, all weeks on same sheet below each other, and so on.

I've now figured that the best way would be to use a single sheet, with 52 weeks below eachother, and to freeze the top row, and put a validation drop-down menu in Cell B1 where I select the week I want to go to, and a command-button with a macro that jumps down to the week in question.

I've got the weeknumbers in column A. Column B and C are reserved for the name and position of the person, and column D-J holds the week-schedule.

I'm just about to tear out my eyes, because I know this should be dead easy. But I seem to have forgotten everything I've ever learned, because I can't see the code..

Anyone?
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Try

Code:
Private Sub CommandButton1_Click()
Dim Found As Range
Set Found = Columns("A").Find(what:=Range("B1").Value, LookIn:=xlValues, lookat:=xlWhole)
If Found Is Nothing Then
    MsgBox "Not found", vbInformation
Else
    Found.Select
End If
End Sub
 
Upvote 0
This has done the trick.
Much appreciated.

Think I got stuck in thinking to much on hlookups and such.

Thanks a million!
 
Upvote 0

Forum statistics

Threads
1,224,508
Messages
6,179,189
Members
452,893
Latest member
denay

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