问题描述:

Due to company media policy I cannot paste the code. I have spent weeks surfing the net looking for the below roadblocks I have come across. As this is my first ever vba coding I'm finally stuck

  1. What I have is a dropdown box with 4 options:

    One option makes button13(or button name in this case “on duty”) visible or enabled, the other 3 do nothing all.

    I have tried

    if range (“b4”) = “on duty” then

    Button13.enabled = true and tried (name.enabled = true)

    Else

    Button13.enabled = false (name.enabled = false)

  2. A different dropdown box on (sheet1) with 4 options with 2 of them I need to have them up the row above onto a different (sheet2) as this runs over a 24 hr period and I have been using the Now date format but need the now date at the time of the update on (sheet1)

All I have been able to find so far is auto update for formulas, and as this is based on the dropdown box and not in a userform.

网友答案:

Hide Forms button if B4= "on duty"

Sub HideButton2()
    If Range("B4") = "on duty" Then
        ActiveSheet.Shapes("Button 2").Visible = False
    Else
        ActiveSheet.Buttons("Button 2").Visible = True
    End If
End Sub
相关阅读:
Top