Q:

Changing the value of cells depending on the format

I have a big Excel file with a list or courses going down one side and then modules across the top. To specify whether a module is in the course, the cell that links the course and module is coloured green but there is no value.
I simply need all the green cells to have a value of y.
Conditional formatting only seems to give me an option to change values to a certain format but not the other way round.

A:

You will need VBA to do that. I don't think Excel gives the user capability to read cell formats. 
Sub PutYesInColouredCells()
    Dim r As Range
    Dim cell As Range

    Set r = Range("B2:F7") ' or wherever your table is located

    For Each cell In r
        If cell.Interior.ColorIndex <> xlColorIndexNone Then
            cell.Value = "y"
        End If
    Next cell

End Sub

To use this, open the Visual Basic Editor (Tools > Macro > Visual Basic Editor), insert a module (right-click on VBAProject and Insert > Module), and then paste the above code in this new module. You can then execute the code from Excel: Tools > Macro... > Macros...

