Pour Les Belges Y en A !!! Uniquemennt Pour Eux !!

_Thierry

XLDnaute Barbatruc
Repose en paix
Bonjour à tous et toutes mes compatriotes...

Un petit barbatruc rien que pour vous !!

NB pensez à mettre :

Menu Excel => Outils / Macro Sécurité => 'Source Sûre' (Trusted Source)
=> 'Laisser Acces au Projet Visual Basic' (Trust Access to Visual Basic Project)

Puis copier coller cette macro dans un module vierge standard...

Option Explicit

Const Sign As String = 'Bonne Fête !! @+Thierry'

Const LblWidth As Integer = 10
Const LblHeigth As Integer = 10
Const LblLeft As Integer = 10
Const LblTop As Integer = 15

Sub AutoBuilder()
Dim ObjUSF As Object
Dim ObjLabel As Object
Dim TopPlusHeight As Integer
Dim x As Byte
Dim VLblLeft As Integer
Dim C As Long, CC As Long
Dim L As String
 
 
Set ObjUSF = ThisWorkbook.VBProject.VBComponents.Add(3)
 
With ObjUSF
    .Properties('Caption') = Sign
    .Properties('Width') = 168
    .Properties('Height') = 158
    .Properties('ShowModal') =
True
 
End With
 
   
For x = 1 To 120
      L = ''
      CC = 0
     
Set ObjLabel = ObjUSF.Designer.Controls.Add('Forms.Label.1')
     
     
         
Select Case x
           
Case 1 To 10
             
If x = 1 Then TopPlusHeight = LblTop
              VLblLeft = 2 * LblLeft
              C = 0
           
Case 11 To 20
             
If x = 11 Then TopPlusHeight = LblTop
              VLblLeft = 3 * LblLeft
              C = 0
           
Case 21 To 30
             
If x = 21 Then TopPlusHeight = LblTop
              VLblLeft = 4 * LblLeft
              C = 0: CC = 65535
             
If x = 26 Then L = Chr(66)
           
Case 31 To 40
             
If x = 31 Then TopPlusHeight = LblTop
              VLblLeft = 5 * LblLeft
              C = 0:: CC = 65535
             
If x = 36 Then L = Chr(69)
           
Case 41 To 50
             
If x = 41 Then TopPlusHeight = LblTop
              VLblLeft = 6 * LblLeft
              C = 65535
           
Case 51 To 60
             
If x = 51 Then TopPlusHeight = LblTop
              VLblLeft = 7 * LblLeft
              C = 65535
             
If x = 56 Then L = Chr(76)
           
Case 61 To 70
             
If x = 61 Then TopPlusHeight = LblTop
              VLblLeft = 8 * LblLeft
              C = 65535
             
If x = 66 Then L = Chr(71)
           
Case 71 To 80
             
If x = 71 Then TopPlusHeight = LblTop
              VLblLeft = 9 * LblLeft
              C = 65535
             
If x = 76 Then L = Chr(73)
           
Case 81 To 90
             
If x = 81 Then TopPlusHeight = LblTop
              VLblLeft = 10 * LblLeft
              C = 255
             
If x = 86 Then L = Chr(81)
           
Case 91 To 100
             
If x = 91 Then TopPlusHeight = LblTop
              VLblLeft = 11 * LblLeft
              C = 255
             
If x = 96 Then L = Chr(85)
           
Case 101 To 110
             
If x = 101 Then TopPlusHeight = LblTop
              VLblLeft = 12 * LblLeft
              C = 255
             
If x = 106 Then L = Chr(69)
           
Case 111 To 120
             
If x = 111 Then TopPlusHeight = LblTop
              VLblLeft = 13 * LblLeft
              C = 255
         
End Select
             
           
With ObjLabel
            .Caption = L
            .ForeColor = CC
            .BackColor = C
            .Left = VLblLeft: .Top = TopPlusHeight: .Width = LblWidth: .Height = LblHeigth
            .Name = 'Thierry' & x
         
End With
         
        TopPlusHeight = TopPlusHeight + 10
   
Next

With VBA.UserForms.Add(ObjUSF.Name)
.Show
End With
Set ObjUSF = Nothing
Set ObjLabel = Nothing
End Sub



;)

Bien à Vous et Bonne Duvel à Tous et Toutes

@+Thierry

EDITION !!!

Petit Allègement de Code qui conservait des Objects inutiles, que j'avais bien entendu déjà écrit pour un truc plus élaboré...

Merci Mr Spock ;)

Message édité par: _Thierry, à: 21/07/2005 18:20
 

_Thierry

XLDnaute Barbatruc
Repose en paix
Bonsoir à Tous

Juste pour les Belges qui étaient de repos today ....



J'espère que vous avez fêté ça, moi pas, mais il faut que j'en parle à Albert II mais pas le même ;)

Bien à vous
@+Thierry
 

andré

XLDnaute Barbatruc
Salut à tous les belges, et aux autres aussi,

Que dire de plus !

Et puis moi j'aime la branbançonne !

Toujours un peu moins belliqueux que les sangs impurs qui abreuvent nos sillons.

Bien que, ... moi la Duvel que je l'ai dans le sang, ... alors abreuvez-vous, ... mais avec modération (espèces de vampires !)

Allez, un peu d'histoire :

1789 - 1790 : La République belge !
1790 - 1792 : Première Restauration Autrichienne
1792 - 1793 : Première occupation française
1793 - 1794 : Deuxième Restauration Autrichienne
1794 - 1794 : Deuxième occupation française
1795 - 1799 : Annexion par la France sous le Directoire
1799 - 1804 : Consulat de Napoléon Bonaparte
1804 - 1814 : Empire de Napoléon
1814 - 1815 : Occupation par les armées Russes, Prusses, Saxes et Suédoises.
1815 - 1830 : Waterloo et annexion par la Hollande ( Prince d'Orange)
1830 - xxxx : Royauté

Ainsi vous n'aurez pas perdu votre temps à me lire, ignares que vous êtes (lol)!

Ândré.
 

Discussions similaires

Réponses
9
Affichages
926
Réponses
8
Affichages
708

Statistiques des forums

Discussions
312 807
Messages
2 092 292
Membres
105 339
dernier inscrit
JPAd