Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
1217 connectés 

  FORUM HardWare.fr
  Programmation
  VB/VBA/VBS

  Help me!

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

Help me!

n°1298632
mike594
Posté le 03-02-2006 à 15:55:55  profilanswer
 

Bonjour!
 
Actuellement j'essai de créer une petite interface me permettant de créer mes fax pour le boulot.
je suis débutant dans le VBA pour excel. j'ai créé tout d'abord, les Userforms puis j'ai essayé de tapé le code correspondant. Mai là, problème je bloque.
 
Je souhaite créer un répertoire à l'aide d'une interface (Userform3)
2 solutions:
- le client existe, alors une seconde interface (Userform2) me prévient  
- le client n'existe pas, et son adresse est immédiatement enregistrée sur la feuille "Liste Noms"
 
voici le code que j'ai tapé:
"Code pour le bouton Ok de la Userform1"
1  Private Sub CommandButton1_Click()
2 Sheets("Liste Noms" ).Select
3 Dim i As Integer
4 Dim cel As Range
5 Set cel = Range("A2" )
6 Do While cel.Offset(i) <> TextBox1
7 If cel.Offset(i) = TextBox1 Then
8     GoTo SuiteB
9     Else: GoTo SuiteA
10 End If
11 Loop
12
13 SuiteA:
14 Do Until cel.Offset(i) = ""
15 i = i + 1
16 Loop
17 Range("A1" ).Offset(i, 0) = UCase(Left(TextBox1, 1)) & LCase(Right(TextBox1, Len(TextBox1) - 1))
18 Range("B1" ).Offset(i, 0) = UCase(Left(TextBox2, 1)) & LCase(Right(TextBox2, Len(TextBox2) - 1))
19 Range("C1" ).Offset(i, 0) = UCase(Left(TextBox3, 1)) & LCase(Right(TextBox3, Len(TextBox2) - 1))
20 Range("D1" ).Offset(i, 0) = UCase(Left(TextBox4, 1)) & LCase(Right(TextBox4, Len(TextBox2) - 1))
21 Range("E1" ).Offset(i, 0) = UCase(Left(TextBox5, 1)) & LCase(Right(TextBox5, Len(TextBox2) - 1))
22 Range("F1" ).Offset(i, 0) = UCase(Left(TextBox6, 1)) & LCase(Right(TextBox6, Len(TextBox2) - 1))
23 Range("G1" ).Offset(i, 0) = UCase(Left(TextBox7, 1)) & LCase(Right(TextBox7, Len(TextBox2) - 1))
24 Range("H1" ).Offset(i, 0) = UCase(Left(TextBox8, 1)) & LCase(Right(TextBox8, Len(TextBox2) - 1))
25 Range("I1" ).Offset(i, 0) = UCase(Left(TextBox9, 1)) & LCase(Right(TextBox9, Len(TextBox2) - 1))
26 Range("J1" ).Offset(i, 0) = UCase(Left(TextBox10, 1)) & LCase(Right(TextBox10, Len(TextBox2) - 1))
27 Unload UserForm1
28 ActiveSheet.Range("A2:Z1000" ).Sort key1:=Range("A2" )
29  
30 SuiteB:
31 Unload UserForm1
32 UserForm2.Show
33  
34 SuiteC:
35 End Sub
-------------------------------------------
"Code pour le bouton Annuler de la Userform1"
Private Sub CommandButton2_Click()
Unload UserForm1
UserForm3.Show
End Sub
[img]http://img143.imageshack.us/my.php?image=organigramme9ee.jpg]http://img143.imageshack.us/img143/7571/organigramme9ee.th.jpg[/URL][/img]

mood
Publicité
Posté le 03-02-2006 à 15:55:55  profilanswer
 

n°1298960
mike594
Posté le 04-02-2006 à 09:49:27  profilanswer
 

Désolé je me suis trompé sur le lien
 
[url]http://img143.imageshack.us/my.php?image=organigramme9ee.jpg][url]


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  VB/VBA/VBS

  Help me!

 

Sujets relatifs
IE vs firefox, BUG de CSS!! help ???Script vba pour diriger autre programme...need help ;)
Help: Comment faire la somme des Produits en XSLT[Help] Boutons dans un clip !!
[Help] Programme nbr premier en c#Mémoire insuffisante Help
please help me :(HELP probleme pour un script d'export de zone DNS
[Help]Comment ouvrir un jeux 2 fois 
Plus de sujets relatifs à : Help me!


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR