The error you are getting is because the Check() function is not declared as a Public function. In order to call a function from another procedure, it must be declared as Public.
To fix this, you need to change the declaration of the Check() function to the following:
Public Function Check() As Boolean
Check = True
End Function
Once you have made this change, the function should be able to be called from the CommandButton1_Click() procedure.
Here is the complete code:
Function Check() As Boolean
Check = True
End Function
Private Sub CommandButton1_Click()
Dim a As Boolean
a = Check()
End Sub
This code will create a Check() function that returns a Boolean value of True. The CommandButton1_Click() procedure will then call the Check() function and store the result in the a variable.
To test the code, you can run the macro by pressing F5. The Check() function will return a value of True, and the a variable will be assigned the value of True.