bonjour le forum j'ai une macro
en feuille "Resum=E9"
Code:
Private Sub ComboBox1_Change()
Dim str As String
Dim i As Integer
Dim LigneBar As Integer
Dim LigneSav As Integer
Dim LigneMat As Integer
Dim LigneCryl As Integer
If str <> "" Then
' Range("A4").FormulaArray =3D "=3D" & str & "!A1"
' Range("A5").FormulaArray =3D "=3D" & str & "!A3"
'Sheets(str).Select
For i =3D 1 To Sheets(str).[a65536].End(xlUp).Row Step 1
If InStr(Sheets(str).Cells(i, 1).FormulaArray, "TOTAL
BARRETTE") Then
LigneBar =3D i
End If
If InStr(Sheets(str).Cells(i, 1).FormulaArray, "TOTAL
MATRICE") Then
LigneMat =3D i
End If
If InStr(Sheets(str).Cells(i, 1).FormulaArray, "TOTAL
CRYL") Then
LigneCryl =3D i
End If
If InStr(Sheets(str).Cells(i, 1).FormulaArray, "TOTAL
SAV") Then
LigneSav =3D i
End If
Next
Range("I35").FormulaArray =3D "=3D" & str & "!K" & LigneBar
Range("I36").FormulaArray =3D "=3D" & str & "!K" & LigneMat
Range("I37").FormulaArray =3D "=3D" & str & "!K" & LigneCryl
Range("I38").FormulaArray =3D "=3D" & str & "!K" & LigneSav
End If
End Sub
en ThisWorlbook:
Code:
Private Sub Workbook_Open()
Dim str As String
Dim taille As Integer
ind =3D 0
Sheets("Resum=E9").Select
Sheets("Resum=E9").ComboBox1.Clear
For i =3D 1 To ThisWorkbook.Sheets.Count Step 1
str =3D Sheets.Item(i).Name
taille =3D Len(str)
If taille <=3D 3 Then
Sheets("Resum=E9").ComboBox1.AddItem (str)
End If
Next
Sheets("Resum=E9").ComboBox1.Value =3D Sheets("Resum=E9").Range
("K3").Value
End Sub
comment faire pour que je puisse mettre =E0 jour sans changer ma semaine
<=3D> K3 qui se trouve dans ma comobox?
cordialement
Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
michdenis
Bonjour Clyver,
Voici un exemple vite fait : http://cjoint.com/?jyvyPb1Twl
"clyver" a écrit dans le message de groupe de discussion :
bonjour le forum j'ai une macro en feuille "Resumé" Code: Private Sub ComboBox1_Change() Dim str As String Dim i As Integer Dim LigneBar As Integer Dim LigneSav As Integer Dim LigneMat As Integer Dim LigneCryl As Integer
If str <> "" Then ' Range("A4").FormulaArray = "=" & str & "!A1" ' Range("A5").FormulaArray = "=" & str & "!A3" 'Sheets(str).Select For i = 1 To Sheets(str).[a65536].End(xlUp).Row Step 1 If InStr(Sheets(str).Cells(i, 1).FormulaArray, "TOTAL BARRETTE") Then LigneBar = i End If If InStr(Sheets(str).Cells(i, 1).FormulaArray, "TOTAL MATRICE") Then LigneMat = i End If If InStr(Sheets(str).Cells(i, 1).FormulaArray, "TOTAL CRYL") Then LigneCryl = i End If If InStr(Sheets(str).Cells(i, 1).FormulaArray, "TOTAL SAV") Then LigneSav = i End If Next Range("I35").FormulaArray = "=" & str & "!K" & LigneBar Range("I36").FormulaArray = "=" & str & "!K" & LigneMat Range("I37").FormulaArray = "=" & str & "!K" & LigneCryl Range("I38").FormulaArray = "=" & str & "!K" & LigneSav End If End Sub
en ThisWorlbook: Code: Private Sub Workbook_Open() Dim str As String Dim taille As Integer
ind = 0 Sheets("Resumé").Select Sheets("Resumé").ComboBox1.Clear
For i = 1 To ThisWorkbook.Sheets.Count Step 1 str = Sheets.Item(i).Name taille = Len(str) If taille <= 3 Then Sheets("Resumé").ComboBox1.AddItem (str) End If Next Sheets("Resumé").ComboBox1.Value = Sheets("Resumé").Range ("K3").Value End Sub
comment faire pour que je puisse mettre à jour sans changer ma semaine <=> K3 qui se trouve dans ma comobox? cordialement
Bonjour Clyver,
Voici un exemple vite fait : http://cjoint.com/?jyvyPb1Twl
"clyver" <clyver@msn.com> a écrit dans le message de groupe de discussion :
0b6aae4f-d041-4136-a1bc-7205210c3326@p36g2000vbn.googlegroups.com...
bonjour le forum j'ai une macro
en feuille "Resumé"
Code:
Private Sub ComboBox1_Change()
Dim str As String
Dim i As Integer
Dim LigneBar As Integer
Dim LigneSav As Integer
Dim LigneMat As Integer
Dim LigneCryl As Integer
If str <> "" Then
' Range("A4").FormulaArray = "=" & str & "!A1"
' Range("A5").FormulaArray = "=" & str & "!A3"
'Sheets(str).Select
For i = 1 To Sheets(str).[a65536].End(xlUp).Row Step 1
If InStr(Sheets(str).Cells(i, 1).FormulaArray, "TOTAL
BARRETTE") Then
LigneBar = i
End If
If InStr(Sheets(str).Cells(i, 1).FormulaArray, "TOTAL
MATRICE") Then
LigneMat = i
End If
If InStr(Sheets(str).Cells(i, 1).FormulaArray, "TOTAL
CRYL") Then
LigneCryl = i
End If
If InStr(Sheets(str).Cells(i, 1).FormulaArray, "TOTAL
SAV") Then
LigneSav = i
End If
Next
Range("I35").FormulaArray = "=" & str & "!K" & LigneBar
Range("I36").FormulaArray = "=" & str & "!K" & LigneMat
Range("I37").FormulaArray = "=" & str & "!K" & LigneCryl
Range("I38").FormulaArray = "=" & str & "!K" & LigneSav
End If
End Sub
en ThisWorlbook:
Code:
Private Sub Workbook_Open()
Dim str As String
Dim taille As Integer
ind = 0
Sheets("Resumé").Select
Sheets("Resumé").ComboBox1.Clear
For i = 1 To ThisWorkbook.Sheets.Count Step 1
str = Sheets.Item(i).Name
taille = Len(str)
If taille <= 3 Then
Sheets("Resumé").ComboBox1.AddItem (str)
End If
Next
Sheets("Resumé").ComboBox1.Value = Sheets("Resumé").Range
("K3").Value
End Sub
comment faire pour que je puisse mettre à jour sans changer ma semaine
<=> K3 qui se trouve dans ma comobox?
cordialement
Voici un exemple vite fait : http://cjoint.com/?jyvyPb1Twl
"clyver" a écrit dans le message de groupe de discussion :
bonjour le forum j'ai une macro en feuille "Resumé" Code: Private Sub ComboBox1_Change() Dim str As String Dim i As Integer Dim LigneBar As Integer Dim LigneSav As Integer Dim LigneMat As Integer Dim LigneCryl As Integer
If str <> "" Then ' Range("A4").FormulaArray = "=" & str & "!A1" ' Range("A5").FormulaArray = "=" & str & "!A3" 'Sheets(str).Select For i = 1 To Sheets(str).[a65536].End(xlUp).Row Step 1 If InStr(Sheets(str).Cells(i, 1).FormulaArray, "TOTAL BARRETTE") Then LigneBar = i End If If InStr(Sheets(str).Cells(i, 1).FormulaArray, "TOTAL MATRICE") Then LigneMat = i End If If InStr(Sheets(str).Cells(i, 1).FormulaArray, "TOTAL CRYL") Then LigneCryl = i End If If InStr(Sheets(str).Cells(i, 1).FormulaArray, "TOTAL SAV") Then LigneSav = i End If Next Range("I35").FormulaArray = "=" & str & "!K" & LigneBar Range("I36").FormulaArray = "=" & str & "!K" & LigneMat Range("I37").FormulaArray = "=" & str & "!K" & LigneCryl Range("I38").FormulaArray = "=" & str & "!K" & LigneSav End If End Sub
en ThisWorlbook: Code: Private Sub Workbook_Open() Dim str As String Dim taille As Integer
ind = 0 Sheets("Resumé").Select Sheets("Resumé").ComboBox1.Clear
For i = 1 To ThisWorkbook.Sheets.Count Step 1 str = Sheets.Item(i).Name taille = Len(str) If taille <= 3 Then Sheets("Resumé").ComboBox1.AddItem (str) End If Next Sheets("Resumé").ComboBox1.Value = Sheets("Resumé").Range ("K3").Value End Sub
comment faire pour que je puisse mettre à jour sans changer ma semaine <=> K3 qui se trouve dans ma comobox? cordialement
"clyver" a écrit dans le message de groupe de discussion :
Bonjour michdenis,
Ton lien ne fonctionne pas chez moi ?
merci bonne matinée
Franck
Essaie ce lien (fichier non compressé)
http://cjoint.com/?jzmc1dlJEb
"clyver" <clyver@msn.com> a écrit dans le message de groupe de discussion :
137c2ad7-a6b2-41c9-87d6-c43305470e4b@m20g2000vbp.googlegroups.com...
Bonjour michdenis,
mais je n'utilise pas "Form1.Show" mais ma premiere macro se trouve en feuille "Resumé"
est il possible d'utiliser une macro type
Sub MAJ_SEM() UserComboBox1 End Sub
merci
michdenis
Il faudrait être plus explicite pour définir tes questions.
Si ton formulaire est ouvert et que tu as un combobox qui affiche une valeur dans ce formulaire, tu peux dans une procédure d'un module quelconque récupérer la valeur affichée par ce combobox en utilisant la ligne de code suivante :
userform1 -> nom de ton formulaire (propriété Name) Combobox -> nom de ton combobox dans ton formulaire.
Msgbox Userform1.Combobox1.Value
"clyver" a écrit dans le message de groupe de discussion :
bonjour
mais je n'utilise pas "Form1.Show" mais ma premiere macro se trouve en feuille "Resumé"
est il possible d'utiliser une macro type
Sub MAJ_SEM() UserComboBox1 End Sub
merci
Il faudrait être plus explicite pour définir tes questions.
Si ton formulaire est ouvert et que tu as un combobox
qui affiche une valeur dans ce formulaire, tu peux dans
une procédure d'un module quelconque récupérer la
valeur affichée par ce combobox en utilisant la ligne
de code suivante :
userform1 -> nom de ton formulaire (propriété Name)
Combobox -> nom de ton combobox dans ton formulaire.
Msgbox Userform1.Combobox1.Value
"clyver" <clyver@msn.com> a écrit dans le message de groupe de discussion :
b061c0ab-99fe-402b-a670-7813463f1b3a@j19g2000vbp.googlegroups.com...
bonjour
mais je n'utilise pas "Form1.Show" mais ma premiere macro se trouve en
feuille "Resumé"
Il faudrait être plus explicite pour définir tes questions.
Si ton formulaire est ouvert et que tu as un combobox qui affiche une valeur dans ce formulaire, tu peux dans une procédure d'un module quelconque récupérer la valeur affichée par ce combobox en utilisant la ligne de code suivante :
userform1 -> nom de ton formulaire (propriété Name) Combobox -> nom de ton combobox dans ton formulaire.
Msgbox Userform1.Combobox1.Value
"clyver" a écrit dans le message de groupe de discussion :
bonjour
mais je n'utilise pas "Form1.Show" mais ma premiere macro se trouve en feuille "Resumé"