I'm really new to <acronym title="visual basic for applications">VBA</acronym> and Excel, I know a few bits and I have created validation lists and a macro to rename the sheetname depending on what text is entered into a certain cell etc.
I don't really know where to begin with creating a macro to report back a list of sheet names onto the "overview/master" sheet if a certain cell on any of the other sheets contains a specific word. What is complicating this matter is I need it to reference a different cell on each sheet, depending on which options are selected from the two drop down boxes on the overview sheet. All in the same workbook btw.
In the most basic form, what I have created is an "OVERVIEW" sheet. This has two drop down boxes (using data validation lists) on it. It has two drop down lists, one contains the text Grade 1, Grade 2 etc) and the other drop down box contains levels e.g. Foundation, Intermediate, Expert etc. Each list has 5 entries.
The rest of the sheets contain a grid matrix 5 rows on the vertical axis (Grade 1-5) and 5 columns on the horizontal axis(levels, eg foundation/intermediate/expert.) Each sheet is the exactly the same template, same reference in the same cells etc. This will then be filled in when someone finishes grade 1 foundation, the box in the matrix that refers to that level would be filled with the text "completed" on that particular sheet. Each person has their own sheet so they will either say completed/in progress/not done depending on who has done what.
I need a macro that will say if the overview sheet C5 = "Grade1" AND E5 = "Foundation" (both the drop down boxes) then loop through all workbook sheets & look at cell E13 (the grade 1 foundation box) and if it says "completed" in that box on any of the sheets, then copy the sheetname into a box on the "overview" sheet in a list in cells I5-I11. so anyone who has completed that level will be listed on the overview sheet. I need it to work for any grade/level that is selected from the two drop down boxes.
What I have so far:
<code>Sub LoopThroughSheets()
If worksheets ("OVERVIEW") GOTO C5="Grade 1" And E5="Foundation" Then
' I want this bit to say if the overview worksheet cell C5 contains grade 1 and cell e5 contains foundation then</code>'
<code> =IF E13="completed", THEN ActiveSheet.Name = Range("I5:I11").Copy)
' I want this bit to then say if the word completed is present in cell E13 on any of the subsequent sheets it should copy the sheet name to the overview sheet in cells I5 to I11'
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
Next ws
End Sub</code>
I don't really know where to begin with creating a macro to report back a list of sheet names onto the "overview/master" sheet if a certain cell on any of the other sheets contains a specific word. What is complicating this matter is I need it to reference a different cell on each sheet, depending on which options are selected from the two drop down boxes on the overview sheet. All in the same workbook btw.
In the most basic form, what I have created is an "OVERVIEW" sheet. This has two drop down boxes (using data validation lists) on it. It has two drop down lists, one contains the text Grade 1, Grade 2 etc) and the other drop down box contains levels e.g. Foundation, Intermediate, Expert etc. Each list has 5 entries.
The rest of the sheets contain a grid matrix 5 rows on the vertical axis (Grade 1-5) and 5 columns on the horizontal axis(levels, eg foundation/intermediate/expert.) Each sheet is the exactly the same template, same reference in the same cells etc. This will then be filled in when someone finishes grade 1 foundation, the box in the matrix that refers to that level would be filled with the text "completed" on that particular sheet. Each person has their own sheet so they will either say completed/in progress/not done depending on who has done what.
I need a macro that will say if the overview sheet C5 = "Grade1" AND E5 = "Foundation" (both the drop down boxes) then loop through all workbook sheets & look at cell E13 (the grade 1 foundation box) and if it says "completed" in that box on any of the sheets, then copy the sheetname into a box on the "overview" sheet in a list in cells I5-I11. so anyone who has completed that level will be listed on the overview sheet. I need it to work for any grade/level that is selected from the two drop down boxes.
What I have so far:
<code>Sub LoopThroughSheets()
If worksheets ("OVERVIEW") GOTO C5="Grade 1" And E5="Foundation" Then
' I want this bit to say if the overview worksheet cell C5 contains grade 1 and cell e5 contains foundation then</code>'
<code> =IF E13="completed", THEN ActiveSheet.Name = Range("I5:I11").Copy)
' I want this bit to then say if the word completed is present in cell E13 on any of the subsequent sheets it should copy the sheet name to the overview sheet in cells I5 to I11'
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
Next ws
End Sub</code>