Brisbane members in sync.
Thanks to you both for replying.
I am aware of what you pointed me at. My problem is that defining "verde" as Public in WorkBook still keeps it invisible to code in Hoja1 (
Sheet1 for you).
Trying to find why, I even came to define the Sub Coloreta, twice, which I know is not correct but it allowed to know that "verde" was being ignored by the rest of the code.
I am in my first steps so bear with me. To be honest I cannot understand where every piece of code should go. Couldn't grasp the basic to know when to put code in Sheet1, WorkBook or a module. Nice mambo!
I accept that everything could be dead wrong here.
Gracias for any help.
Code:
Option Explicit
Public verde As Variant
Private Sub Workbook_Open()
Let verde = 135
Call Coloreta
End Sub
Private Sub Coloreta()
Range("D15") = verde
With ActiveSheet.Shapes("Oval 7").Fill
.Visible = msoTrue
.ForeColor.RGB = RGB(0, verde, 0)
.BackColor.RGB = RGB(0, 135, 0)
.TwoColorGradient msoGradientFromCenter, 1
.Transparency = 0#
End With
End Sub
Code:
Option Explicit
Public verde As Variant
Private Sub SpinButton_G_SpinUp()
If verde < 255 Then
verde = verde + 60
End If
Worksheets("Hoja1").Cells(5, 3).Value = verde - 2
Worksheets("Hoja1").Cells(5, 7).Value = "Spinup"
Call Coloreta1
End Sub
Private Sub SpinButton_G_SpinDown()
If verde > 15 Then
verde = verde - 60
End If
Worksheets("Hoja1").Cells(5, 3).Value = verde + 2
Worksheets("Hoja1").Cells(5, 7).Value = "Spindown"
Call Coloreta1
End Sub
Private Sub Coloreta()
With ActiveSheet.Shapes("Oval 7").Fill
.Visible = msoTrue
.ForeColor.RGB = RGB(0, verde, 0)
.BackColor.RGB = RGB(0, 135, 0)
.TwoColorGradient msoGradientFromCenter, 1
.Transparency = 0#
End With
End Sub