Lien entre un formulaire et une feuille excel

Lady1010 Messages postés 2 Statut Membre -  
f894009 Messages postés 17417 Date d'inscription   Statut Membre Dernière intervention   -
Bonjour,

J'ai réalisé un questionnaire à l'aide d'une VB cependant, je ne parviens pas à mettre en liens mon questionnaire à ma feuille d'excel.... et avant je pouvais mais je ne pouvais pas mettre les réponses à la suite...

Pourriez-vous m'aider???

Merci par avance!!!

2 réponses

  1. f894009 Messages postés 17417 Date d'inscription   Statut Membre Dernière intervention   1 717
     
    Bonjour,

    Avec votre fichier, ca irait mieux

    Pour transmettre un fichier,
    Veillez a ce qu'il n'y ait PAS DE DONNEES CONFIDENTIELLES
    il faut passer par un site de pièce jointe tel que cjoint.com

    Allez sur ce site : https://www.cjoint.com/
    Clic sur parcourir,
    Cherche ton fichier,
    clic sur ouvrir,
    Clic sur "Créer le lien cjoint",
    Copier le lien,
    Revenir ici le coller dans une réponse...
    0
  2. Lady1010 Messages postés 2 Statut Membre
     
    Bonjour,

    Je n'arrive pas à mettre le fichier du coup je vais mettre la macro
    Private Sub Macro1()

    Option Explicit
    Dim Ws As Worksheet

    Worksheets("Sous_traitant").Activate
    Cells(4, 2).Select

    End Sub

    'Pour le formualire
    Private Sub UserForm_Initialise()
    Dim J As Long

    Dim I As Integer

    TextBox3.ColumnsCount = 1 'Pour avoir les informations sur la personne
    Set Ws = Sheets("Sous_traitant") 'Correspond au nom de l'onglet dans le fichier Excel

    With Me.TextBox1
    For J = 3 To Ws.Range("A" & Rows.Count).End(xlUp).Row
    .AddItem Ws.Range("A" & J)

    Next J
    End With
    For I = 1 To 14
    Me.Controls("TextBox" & I).Visible = True
    Next I
    End Sub

    'Pour enregistrer les données dans le formualire

    Private Sub CommandButton_Click() 'pour valider
    Dim l As Integer

    'Pour enregistrer les données
    Sheets("Sous_traitant").Select

    l = Sheets("Sous_traitant ").Range("a65536").End(xlUp).Row + 1 'Pour placer le nouvel enregistrement à la première ligne de tableau non vide
    Selection.CellFormat = True
    End If

    If Range("CG5").Value = "Precedent" Then
    l = Cheets("Sous_traitant").Range("A65536").End(xlUp).Row
    End If

    TextBox1 = Range("B" & l).Value
    TextBox2 = Range("C" & l).Value
    TextBox3 = Range("D" & l).Value
    DTPicker1 = Range("F" & l).Value
    DTPicker2 = Range("G" & l).Value
    DTPicker3 = Range("H" & l).Value
    DTPicker4 = Range("I" & l).Value
    DTPicker5 = Range("J" & l).Value
    DTPicker6 = Range("K" & l).Value
    DTPicker7 = Range("L" & l).Value
    DTPicker8 = Range("M" & l).Value
    DTPicker9 = Range("N" & l).Value
    DTPicker10 = Range("O" & l).Value
    DTPicker11 = Range("P" & l).Value
    DTPicker12 = Range("Q" & l).Value
    DTPicker13 = Range("R" & l).Value
    DTPicker14 = Range("S" & l).Value

    End If

    End Sub

    Private Sub CommandButton1_Click() 'valider le questionnaire

    End Sub

    Private Sub DTPicker11_CallckKeyDown(ByVal KeyCode As Integer, ByVal Shift As Integer, ByVal CallbackField As String, CallbackDate As Date)

    End Sub

    Private Sub DTPicker8_CallckKeyDown(ByVal KeyCode As Integer, ByVal Shift As Integer, ByVal CallbackField As String, CallbackDate As Date)

    End Sub

    Private Sub Label1_Click()

    End Sub

    Private Sub Label14_Click()

    End Sub

    Private Sub Label17_Click()

    End Sub

    Private Sub Label4_Click()

    End Sub
    Private Sub Label8_Click()

    End Sub

    Private Sub UserForm_Click()

    End Sub
    0
    1. f894009 Messages postés 17417 Date d'inscription   Statut Membre Dernière intervention   1 717
       
      Bonjour,

      Je n'arrive pas à mettre le fichier
      Reltivement simple, pourtant!!!!

      Il faut votre fichier, trop d'objets a mettre, sauf si cela vient de ceci:
      l = Cheets("Sous_traitant").Range("A65536").End(xlUp).Row
      0