IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Macros et VBA Excel Discussion :

[VBA-E] tetxbox visible malgre visible a false


Sujet :

Macros et VBA Excel

  1. #1
    Membre régulier Avatar de lio62
    Profil pro
    Inscrit en
    Décembre 2006
    Messages
    472
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2006
    Messages : 472
    Points : 101
    Points
    101
    Par défaut [VBA-E] tetxbox visible malgre visible a false
    bonsoir ma textbox (cellheure) reste visible malgré que je lui demande d'être invisible selon condition voici le code :

    Ouskel je parierai que ca te dit quelquechose !!

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    Option Explicit
    Private Sub cbox1_Click()
    laprocedure cbox1.ListIndex
    End Sub
    Private Sub cbox2_Click()
    laprocedure cbox2.ListIndex
    End Sub
    Private Sub cbox3_Click()
    laprocedure cbox3.ListIndex
    End Sub
    Private Sub cbox4_Click()
    laprocedure cbox4.ListIndex
    End Sub
     
    Private Sub cbox5_Change()
    End Sub
     
    Private Sub cbox5_Click()
    laprocedure cbox5.ListIndex
    End Sub
     
    Private Sub cbox6_Click()
    laprocedure cbox6.ListIndex
    End Sub
    Private Sub cbox7_Click()
    laprocedure cbox7.ListIndex
    End Sub
    Private Sub cbox8_Click()
    laprocedure cbox8.ListIndex
     
    End Sub
     
     
    Private Sub cbox9_Click()
    laprocedure cbox9.ListIndex
    'ATESTER.cbox9.Text = Format(cbox9.Value), "dd/mm/yyyy")
    End Sub
    Private Sub cbox10_Click()
    laprocedure cbox10.ListIndex
    End Sub
    Private Sub cbox11_Click()
    laprocedure cbox11.ListIndex
    End Sub
    Private Sub cbox12_Click()
    laprocedure cbox12.ListIndex
    End Sub
    Private Sub cbox13_Click()
    laprocedure cbox13.ListIndex
    End Sub
    Private Sub cbox14_Click()
    laprocedure cbox14.ListIndex
    End Sub
    Sub laprocedure(Lindex)
    Dim lecontrol As Object
    For Each lecontrol In bduserf.Controls
    If InStr(lecontrol.Name, "cbox") = 1 Then
        bduserf.Controls(lecontrol.Name).ListIndex = Lindex
    End If
    Next
    If cbox9.ListIndex <> 1 Then
        CellHeure.Value = Format(cbox9.Value, "dd/mm/yy hh:mm")
        CellHeure.Visible = True
    End If
    End Sub
     
    Private Sub cbox9_DropButtonClick()
    If cbox9.ListIndex <> 1 Then
        CellHeure.Value = Format(cbox9.Value, "dd/mm/yy hh:mm")
    End If
    CellHeure.Visible = True
     
    End Sub
     
    Private Sub cbox9_Enter()
    CellHeure.Visible = False
    End Sub
     
    Private Sub CellHeure_Enter()
    CellHeure.Visible = False
    cbox9.SetFocus
    End Sub
     
    Private Sub CommandButton1_Click()
    End
    End Sub
     
    Private Sub SpinButton1_Change()
    Dim Dernièreligne As Integer
    Dim NoLigne As Integer
    Dernièreligne = ActiveSheet.Range("A1").SpecialCells(xlCellTypeLastCell).Row
    NoLigne = Dernièreligne - SpinButton1.Value
    laprocedure NoLigne
    Label1 = NoLigne + 1
    End Sub
     
     
    Private Sub UserForm_Initialize()
    Dim Dernièreligne As Integer, i As Integer
     
     
        Sheets("Bd").Activate
        Dernièreligne = ActiveSheet.Range("A1").SpecialCells(xlCellTypeLastCell).Row
        Debug.Print Dernièreligne
        With SpinButton1
             .Min = 2
             .Max = Dernièreligne
             .SmallChange = 1
        End With
     
        For i = 1 To 14
            InitCombo Dernièreligne, i
        Next
        CellHeure.Visible = False
        cbox8.Visible = False
     
    cbox9.Visible = Not [S1] = "USP"
    'CellHeure.Visible = Application.UserName = "USP"
     CellHeure.Visible = Not [S1] = "USP"
     
        End Sub
     
    Sub InitCombo(NoLigne, NoColonne)
    Dim NomCombo As String
    Dim Plage As String
    Sheets("Bd").Activate
        Plage = Range(Cells(2, NoColonne), Cells(NoLigne, NoColonne)).Address
        NomCombo = "cbox" & NoColonne
        With bduserf.Controls(NomCombo)
            .Value = Cells(1, NoColonne)
            .RowSource = Plage
        End With
    End Sub

  2. #2
    Inactif  
    Avatar de ouskel'n'or
    Profil pro
    Inscrit en
    Février 2005
    Messages
    12 464
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2005
    Messages : 12 464
    Points : 15 546
    Points
    15 546
    Par défaut
    (déjà là ?)
    Tu vas me dire que je suis curieux mais... koicaisse [S1] ?

  3. #3
    Membre régulier Avatar de lio62
    Profil pro
    Inscrit en
    Décembre 2006
    Messages
    472
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2006
    Messages : 472
    Points : 101
    Points
    101
    Par défaut
    [s1] c'est la cellule ou il y a USP

    au fait quand l'userform s'affiche pas de PB mais des que j'utilise le spinbutton seul la textbox (cellheur) apparait

    merci a+

  4. #4
    Inactif  
    Avatar de ouskel'n'or
    Profil pro
    Inscrit en
    Février 2005
    Messages
    12 464
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2005
    Messages : 12 464
    Points : 15 546
    Points
    15 546
    Par défaut
    Là, tout de suite, je sature un peu, tu vois... Essai de déplacer ta ligne CellHeure.Visible = True et place-la dans ta condition

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    Private Sub cbox9_DropButtonClick()
    If cbox9.ListIndex <> 1 Then
        CellHeure.Value = Format(cbox9.Value, "dd/mm/yy hh:mm")
        CellHeure.Visible = True
    End If
    End Sub
    Sans garantie... et si ce n'est pas ça, ben... Bon courage, je suivrai tes progrès
    A+

  5. #5
    Membre régulier Avatar de lio62
    Profil pro
    Inscrit en
    Décembre 2006
    Messages
    472
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2006
    Messages : 472
    Points : 101
    Points
    101
    Par défaut
    J'ai mis ca dans sub laprocedure()


    Code : Sélectionner tout - Visualiser dans une fenêtre à part
     CellHeure.Visible = Not [S1] = "TU"

    et ca marche


    merci oukel
    a+

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. vba - Excel invisible et userform visible
    Par House MD dans le forum Macros et VBA Excel
    Réponses: 9
    Dernier message: 08/02/2008, 21h26
  2. [formulaire][vba] garder ouvert mais non visible
    Par mystikgirl30 dans le forum IHM
    Réponses: 18
    Dernier message: 26/04/2007, 14h00
  3. [VBA-E]Conserver un classeur visible lorsqu'il perd son focus
    Par ClaudeGil dans le forum Macros et VBA Excel
    Réponses: 1
    Dernier message: 19/11/2006, 12h06
  4. Réponses: 1
    Dernier message: 23/05/2006, 19h10
  5. Web browser visible or propriété a false ?
    Par Tempotpo dans le forum Web & réseau
    Réponses: 3
    Dernier message: 11/08/2005, 10h58

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo