I would like to create a macros to do the following -- When the user clicks on the "Lessons" button or the
"Story" button, macros will detect which row and column the button is being clicked and opens the appropriate
Lesson or Story.
Basically, I created a pacing guide for my school for Kindergarten through 6th Grade (sorted by
rows) starting from the first week of September 2012 to the second week of June 2013 (sorted by columns). I'd like to create
buttons for each grade level and for each week that allow my teachers to just click and view the week's lesson plans for
their grade level and the story that corresponds to these lesson plans.
I set up something like this to test
opening a PDF when the button was clicked. It worked, but I wanted to avoide writing a separate Macros for each button.
Dim strFolder As String
Dim strGrade As String
Dim strWeek As String
'Sets Folder Location
strFolder = "E:PacingGuide"
'Sets Grade Level
strGrade = "6"
'Sets Week Number on Pacing Gude
strWeek = "1"
'Declares PDF File Location
strPDFFile = strFolder & strGrade & strWeek & "LessonPlan.pdf"
'Open PDF File
ActiveWorkbook.FollowHyperlink Address:=strPDFFile, NewWindow:=True
I feel like there should be a way to use an If..Then here.
If the command button being
selected is in Row 34 (6th Grade) and Column D (Week 1) Then Open the 6th Grade's 1st Week Lesson Plans
command button being selected is in Row 34 (6th Grade) and Column E (Week 2) Then Open the 6th Grade's 2nd Week Lesson
I'm learning VBA programming, so any advice would help =) Thanks to those who post!