ouops j'ai oublie la maco :
Sub colonnesEnCentimetres()
Dim cm As Integer, points As Integer, savewidth As Integer
Dim count As Integer
Application.ScreenUpdating = False
cm = Application.InputBox("entrer la largeur de la colonne en cms",
"Largeur de la colonne souhaitée", Type:=1)
If cm = False Then Exit Sub
points = Application.CentimetersToPoints(cm)
savewidth = ActiveCell.ColumnWidth
ActiveCell.ColumnWidth = 255
If points > ActiveCell.Width Then
MsgBox "la largeur de" & cm & "est trop large" & Chr(10) &
_
"la valeur maxi est de " & _
Format(ActiveCell.Width / 28.3464566929134, _
"0.00"), vbOKOnly + vbExclamation, "largeur non valable"
ActiveCell.ColumnWidth = savewidth
Exit Sub
End If
lowerwidth = 0
upwidth = 255
ActiveCell.ColumnWidth = 127.5
curwidth = ActiveCell.ColumnWidth
count = 0
While (ActiveCell.Width <> points) And (count < 20)
If ActiveCell.Width < points Then
lowerwidth = curwidth
Selection.ColumnWidth = (curwidth + upwidth) / 2
Else
upwidth = curwidth
Selection.ColumnWidth = (curwidth + lowerwidth) / 2
End If
curwidth = ActiveCell.ColumnWidth
count = count + 1
Wend
End Sub
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
anonymousA
Bonjour,
je ne sais pas si ca fait ce que tu veux du point de vue de l'algorithme mais du point de vue de la syntaxe, il n'y a pas d'erreur de syntaxe du moins quand je retravaille le texte en fonction de la troncature par le logiciel de messagerie.
A+
On 6 fév, 10:59, sasha wrote:
ouops j'ai oublie la maco : Sub colonnesEnCentimetres() Dim cm As Integer, points As Integer, savewidth As Integer Dim count As Integer Application.ScreenUpdating = False cm = Application.InputBox("entrer la largeur de la colonne en cms", "Largeur de la colonne souhaitée", Type:=1) If cm = False Then Exit Sub points = Application.CentimetersToPoints(cm) savewidth = ActiveCell.ColumnWidth ActiveCell.ColumnWidth = 255 If points > ActiveCell.Width Then MsgBox "la largeur de" & cm & "est trop large" & Chr(10) & _ "la valeur maxi est de " & _ Format(ActiveCell.Width / 28.3464566929134, _ "0.00"), vbOKOnly + vbExclamation, "largeur non valable" ActiveCell.ColumnWidth = savewidth Exit Sub End If lowerwidth = 0 upwidth = 255 ActiveCell.ColumnWidth = 127.5 curwidth = ActiveCell.ColumnWidth count = 0 While (ActiveCell.Width <> points) And (count < 20) If ActiveCell.Width < points Then lowerwidth = curwidth Selection.ColumnWidth = (curwidth + upwidth) / 2 Else upwidth = curwidth Selection.ColumnWidth = (curwidth + lowerwidth) / 2 End If curwidth = ActiveCell.ColumnWidth count = count + 1 Wend End Sub
-- sasha
Bonjour,
je ne sais pas si ca fait ce que tu veux du point de vue de
l'algorithme mais du point de vue de la syntaxe, il n'y a pas d'erreur
de syntaxe du moins quand je retravaille le texte en fonction de la
troncature par le logiciel de messagerie.
A+
On 6 fév, 10:59, sasha <s...@discussions.microsoft.com> wrote:
ouops j'ai oublie la maco :
Sub colonnesEnCentimetres()
Dim cm As Integer, points As Integer, savewidth As Integer
Dim count As Integer
Application.ScreenUpdating = False
cm = Application.InputBox("entrer la largeur de la colonne en cms",
"Largeur de la colonne souhaitée", Type:=1)
If cm = False Then Exit Sub
points = Application.CentimetersToPoints(cm)
savewidth = ActiveCell.ColumnWidth
ActiveCell.ColumnWidth = 255
If points > ActiveCell.Width Then
MsgBox "la largeur de" & cm & "est trop large" & Chr(10) &
_
"la valeur maxi est de " & _
Format(ActiveCell.Width / 28.3464566929134, _
"0.00"), vbOKOnly + vbExclamation, "largeur non valable"
ActiveCell.ColumnWidth = savewidth
Exit Sub
End If
lowerwidth = 0
upwidth = 255
ActiveCell.ColumnWidth = 127.5
curwidth = ActiveCell.ColumnWidth
count = 0
While (ActiveCell.Width <> points) And (count < 20)
If ActiveCell.Width < points Then
lowerwidth = curwidth
Selection.ColumnWidth = (curwidth + upwidth) / 2
Else
upwidth = curwidth
Selection.ColumnWidth = (curwidth + lowerwidth) / 2
End If
curwidth = ActiveCell.ColumnWidth
count = count + 1
Wend
End Sub
je ne sais pas si ca fait ce que tu veux du point de vue de l'algorithme mais du point de vue de la syntaxe, il n'y a pas d'erreur de syntaxe du moins quand je retravaille le texte en fonction de la troncature par le logiciel de messagerie.
A+
On 6 fév, 10:59, sasha wrote:
ouops j'ai oublie la maco : Sub colonnesEnCentimetres() Dim cm As Integer, points As Integer, savewidth As Integer Dim count As Integer Application.ScreenUpdating = False cm = Application.InputBox("entrer la largeur de la colonne en cms", "Largeur de la colonne souhaitée", Type:=1) If cm = False Then Exit Sub points = Application.CentimetersToPoints(cm) savewidth = ActiveCell.ColumnWidth ActiveCell.ColumnWidth = 255 If points > ActiveCell.Width Then MsgBox "la largeur de" & cm & "est trop large" & Chr(10) & _ "la valeur maxi est de " & _ Format(ActiveCell.Width / 28.3464566929134, _ "0.00"), vbOKOnly + vbExclamation, "largeur non valable" ActiveCell.ColumnWidth = savewidth Exit Sub End If lowerwidth = 0 upwidth = 255 ActiveCell.ColumnWidth = 127.5 curwidth = ActiveCell.ColumnWidth count = 0 While (ActiveCell.Width <> points) And (count < 20) If ActiveCell.Width < points Then lowerwidth = curwidth Selection.ColumnWidth = (curwidth + upwidth) / 2 Else upwidth = curwidth Selection.ColumnWidth = (curwidth + lowerwidth) / 2 End If curwidth = ActiveCell.ColumnWidth count = count + 1 Wend End Sub
-- sasha
sasha
desolée mais j'ai re essayé et j'obtiens toujours mon message d'erreur erreur de compilation erreur de syntaxe - -- sasha
Bonjour,
je ne sais pas si ca fait ce que tu veux du point de vue de l'algorithme mais du point de vue de la syntaxe, il n'y a pas d'erreur de syntaxe du moins quand je retravaille le texte en fonction de la troncature par le logiciel de messagerie.
A+
On 6 fév, 10:59, sasha wrote:
ouops j'ai oublie la maco : Sub colonnesEnCentimetres() Dim cm As Integer, points As Integer, savewidth As Integer Dim count As Integer Application.ScreenUpdating = False cm = Application.InputBox("entrer la largeur de la colonne en cms", "Largeur de la colonne souhaitée", Type:=1) If cm = False Then Exit Sub points = Application.CentimetersToPoints(cm) savewidth = ActiveCell.ColumnWidth ActiveCell.ColumnWidth = 255 If points > ActiveCell.Width Then MsgBox "la largeur de" & cm & "est trop large" & Chr(10) & _ "la valeur maxi est de " & _ Format(ActiveCell.Width / 28.3464566929134, _ "0.00"), vbOKOnly + vbExclamation, "largeur non valable" ActiveCell.ColumnWidth = savewidth Exit Sub End If lowerwidth = 0 upwidth = 255 ActiveCell.ColumnWidth = 127.5 curwidth = ActiveCell.ColumnWidth count = 0 While (ActiveCell.Width <> points) And (count < 20) If ActiveCell.Width < points Then lowerwidth = curwidth Selection.ColumnWidth = (curwidth + upwidth) / 2 Else upwidth = curwidth Selection.ColumnWidth = (curwidth + lowerwidth) / 2 End If curwidth = ActiveCell.ColumnWidth count = count + 1 Wend End Sub
-- sasha
desolée mais j'ai re essayé et j'obtiens toujours mon message d'erreur erreur
de compilation erreur de syntaxe -
--
sasha
Bonjour,
je ne sais pas si ca fait ce que tu veux du point de vue de
l'algorithme mais du point de vue de la syntaxe, il n'y a pas d'erreur
de syntaxe du moins quand je retravaille le texte en fonction de la
troncature par le logiciel de messagerie.
A+
On 6 fév, 10:59, sasha <s...@discussions.microsoft.com> wrote:
ouops j'ai oublie la maco :
Sub colonnesEnCentimetres()
Dim cm As Integer, points As Integer, savewidth As Integer
Dim count As Integer
Application.ScreenUpdating = False
cm = Application.InputBox("entrer la largeur de la colonne en cms",
"Largeur de la colonne souhaitée", Type:=1)
If cm = False Then Exit Sub
points = Application.CentimetersToPoints(cm)
savewidth = ActiveCell.ColumnWidth
ActiveCell.ColumnWidth = 255
If points > ActiveCell.Width Then
MsgBox "la largeur de" & cm & "est trop large" & Chr(10) &
_
"la valeur maxi est de " & _
Format(ActiveCell.Width / 28.3464566929134, _
"0.00"), vbOKOnly + vbExclamation, "largeur non valable"
ActiveCell.ColumnWidth = savewidth
Exit Sub
End If
lowerwidth = 0
upwidth = 255
ActiveCell.ColumnWidth = 127.5
curwidth = ActiveCell.ColumnWidth
count = 0
While (ActiveCell.Width <> points) And (count < 20)
If ActiveCell.Width < points Then
lowerwidth = curwidth
Selection.ColumnWidth = (curwidth + upwidth) / 2
Else
upwidth = curwidth
Selection.ColumnWidth = (curwidth + lowerwidth) / 2
End If
curwidth = ActiveCell.ColumnWidth
count = count + 1
Wend
End Sub
desolée mais j'ai re essayé et j'obtiens toujours mon message d'erreur erreur de compilation erreur de syntaxe - -- sasha
Bonjour,
je ne sais pas si ca fait ce que tu veux du point de vue de l'algorithme mais du point de vue de la syntaxe, il n'y a pas d'erreur de syntaxe du moins quand je retravaille le texte en fonction de la troncature par le logiciel de messagerie.
A+
On 6 fév, 10:59, sasha wrote:
ouops j'ai oublie la maco : Sub colonnesEnCentimetres() Dim cm As Integer, points As Integer, savewidth As Integer Dim count As Integer Application.ScreenUpdating = False cm = Application.InputBox("entrer la largeur de la colonne en cms", "Largeur de la colonne souhaitée", Type:=1) If cm = False Then Exit Sub points = Application.CentimetersToPoints(cm) savewidth = ActiveCell.ColumnWidth ActiveCell.ColumnWidth = 255 If points > ActiveCell.Width Then MsgBox "la largeur de" & cm & "est trop large" & Chr(10) & _ "la valeur maxi est de " & _ Format(ActiveCell.Width / 28.3464566929134, _ "0.00"), vbOKOnly + vbExclamation, "largeur non valable" ActiveCell.ColumnWidth = savewidth Exit Sub End If lowerwidth = 0 upwidth = 255 ActiveCell.ColumnWidth = 127.5 curwidth = ActiveCell.ColumnWidth count = 0 While (ActiveCell.Width <> points) And (count < 20) If ActiveCell.Width < points Then lowerwidth = curwidth Selection.ColumnWidth = (curwidth + upwidth) / 2 Else upwidth = curwidth Selection.ColumnWidth = (curwidth + lowerwidth) / 2 End If curwidth = ActiveCell.ColumnWidth count = count + 1 Wend End Sub
-- sasha
MichDenis
Ton code est bon. Sauf que ton code a des lignes qui sont coupées au mauvais endroit. Tu trouveras la même procédure avec les petites corrections dans le module 1 du fichier suivant : http://cjoint.com/?chpVAvkcLh
"sasha" a écrit dans le message de news:
ouops j'ai oublie la maco : Sub colonnesEnCentimetres() Dim cm As Integer, points As Integer, savewidth As Integer Dim count As Integer Application.ScreenUpdating = False cm = Application.InputBox("entrer la largeur de la colonne en cms", "Largeur de la colonne souhaitée", Type:=1) If cm = False Then Exit Sub points = Application.CentimetersToPoints(cm) savewidth = ActiveCell.ColumnWidth ActiveCell.ColumnWidth = 255 If points > ActiveCell.Width Then MsgBox "la largeur de" & cm & "est trop large" & Chr(10) & _ "la valeur maxi est de " & _ Format(ActiveCell.Width / 28.3464566929134, _ "0.00"), vbOKOnly + vbExclamation, "largeur non valable" ActiveCell.ColumnWidth = savewidth Exit Sub End If lowerwidth = 0 upwidth = 255 ActiveCell.ColumnWidth = 127.5 curwidth = ActiveCell.ColumnWidth count = 0 While (ActiveCell.Width <> points) And (count < 20) If ActiveCell.Width < points Then lowerwidth = curwidth Selection.ColumnWidth = (curwidth + upwidth) / 2 Else upwidth = curwidth Selection.ColumnWidth = (curwidth + lowerwidth) / 2 End If curwidth = ActiveCell.ColumnWidth count = count + 1 Wend End Sub
-- sasha
Ton code est bon. Sauf que ton code a des lignes qui sont coupées
au mauvais endroit. Tu trouveras la même procédure avec les
petites corrections dans le module 1 du fichier suivant :
http://cjoint.com/?chpVAvkcLh
"sasha" <sasha@discussions.microsoft.com> a écrit dans le message de news:
F44B17A5-201D-433C-BC7B-F3249A143687@microsoft.com...
ouops j'ai oublie la maco :
Sub colonnesEnCentimetres()
Dim cm As Integer, points As Integer, savewidth As Integer
Dim count As Integer
Application.ScreenUpdating = False
cm = Application.InputBox("entrer la largeur de la colonne en cms",
"Largeur de la colonne souhaitée", Type:=1)
If cm = False Then Exit Sub
points = Application.CentimetersToPoints(cm)
savewidth = ActiveCell.ColumnWidth
ActiveCell.ColumnWidth = 255
If points > ActiveCell.Width Then
MsgBox "la largeur de" & cm & "est trop large" & Chr(10) &
_
"la valeur maxi est de " & _
Format(ActiveCell.Width / 28.3464566929134, _
"0.00"), vbOKOnly + vbExclamation, "largeur non valable"
ActiveCell.ColumnWidth = savewidth
Exit Sub
End If
lowerwidth = 0
upwidth = 255
ActiveCell.ColumnWidth = 127.5
curwidth = ActiveCell.ColumnWidth
count = 0
While (ActiveCell.Width <> points) And (count < 20)
If ActiveCell.Width < points Then
lowerwidth = curwidth
Selection.ColumnWidth = (curwidth + upwidth) / 2
Else
upwidth = curwidth
Selection.ColumnWidth = (curwidth + lowerwidth) / 2
End If
curwidth = ActiveCell.ColumnWidth
count = count + 1
Wend
End Sub
Ton code est bon. Sauf que ton code a des lignes qui sont coupées au mauvais endroit. Tu trouveras la même procédure avec les petites corrections dans le module 1 du fichier suivant : http://cjoint.com/?chpVAvkcLh
"sasha" a écrit dans le message de news:
ouops j'ai oublie la maco : Sub colonnesEnCentimetres() Dim cm As Integer, points As Integer, savewidth As Integer Dim count As Integer Application.ScreenUpdating = False cm = Application.InputBox("entrer la largeur de la colonne en cms", "Largeur de la colonne souhaitée", Type:=1) If cm = False Then Exit Sub points = Application.CentimetersToPoints(cm) savewidth = ActiveCell.ColumnWidth ActiveCell.ColumnWidth = 255 If points > ActiveCell.Width Then MsgBox "la largeur de" & cm & "est trop large" & Chr(10) & _ "la valeur maxi est de " & _ Format(ActiveCell.Width / 28.3464566929134, _ "0.00"), vbOKOnly + vbExclamation, "largeur non valable" ActiveCell.ColumnWidth = savewidth Exit Sub End If lowerwidth = 0 upwidth = 255 ActiveCell.ColumnWidth = 127.5 curwidth = ActiveCell.ColumnWidth count = 0 While (ActiveCell.Width <> points) And (count < 20) If ActiveCell.Width < points Then lowerwidth = curwidth Selection.ColumnWidth = (curwidth + upwidth) / 2 Else upwidth = curwidth Selection.ColumnWidth = (curwidth + lowerwidth) / 2 End If curwidth = ActiveCell.ColumnWidth count = count + 1 Wend End Sub
-- sasha
sasha
merci beaucoup je m'en sers de suite -- sasha
Ton code est bon. Sauf que ton code a des lignes qui sont coupées au mauvais endroit. Tu trouveras la même procédure avec les petites corrections dans le module 1 du fichier suivant : http://cjoint.com/?chpVAvkcLh
"sasha" a écrit dans le message de news:
ouops j'ai oublie la maco : Sub colonnesEnCentimetres() Dim cm As Integer, points As Integer, savewidth As Integer Dim count As Integer Application.ScreenUpdating = False cm = Application.InputBox("entrer la largeur de la colonne en cms", "Largeur de la colonne souhaitée", Type:=1) If cm = False Then Exit Sub points = Application.CentimetersToPoints(cm) savewidth = ActiveCell.ColumnWidth ActiveCell.ColumnWidth = 255 If points > ActiveCell.Width Then MsgBox "la largeur de" & cm & "est trop large" & Chr(10) & _ "la valeur maxi est de " & _ Format(ActiveCell.Width / 28.3464566929134, _ "0.00"), vbOKOnly + vbExclamation, "largeur non valable" ActiveCell.ColumnWidth = savewidth Exit Sub End If lowerwidth = 0 upwidth = 255 ActiveCell.ColumnWidth = 127.5 curwidth = ActiveCell.ColumnWidth count = 0 While (ActiveCell.Width <> points) And (count < 20) If ActiveCell.Width < points Then lowerwidth = curwidth Selection.ColumnWidth = (curwidth + upwidth) / 2 Else upwidth = curwidth Selection.ColumnWidth = (curwidth + lowerwidth) / 2 End If curwidth = ActiveCell.ColumnWidth count = count + 1 Wend End Sub
-- sasha
merci beaucoup je m'en sers de suite
--
sasha
Ton code est bon. Sauf que ton code a des lignes qui sont coupées
au mauvais endroit. Tu trouveras la même procédure avec les
petites corrections dans le module 1 du fichier suivant :
http://cjoint.com/?chpVAvkcLh
"sasha" <sasha@discussions.microsoft.com> a écrit dans le message de news:
F44B17A5-201D-433C-BC7B-F3249A143687@microsoft.com...
ouops j'ai oublie la maco :
Sub colonnesEnCentimetres()
Dim cm As Integer, points As Integer, savewidth As Integer
Dim count As Integer
Application.ScreenUpdating = False
cm = Application.InputBox("entrer la largeur de la colonne en cms",
"Largeur de la colonne souhaitée", Type:=1)
If cm = False Then Exit Sub
points = Application.CentimetersToPoints(cm)
savewidth = ActiveCell.ColumnWidth
ActiveCell.ColumnWidth = 255
If points > ActiveCell.Width Then
MsgBox "la largeur de" & cm & "est trop large" & Chr(10) &
_
"la valeur maxi est de " & _
Format(ActiveCell.Width / 28.3464566929134, _
"0.00"), vbOKOnly + vbExclamation, "largeur non valable"
ActiveCell.ColumnWidth = savewidth
Exit Sub
End If
lowerwidth = 0
upwidth = 255
ActiveCell.ColumnWidth = 127.5
curwidth = ActiveCell.ColumnWidth
count = 0
While (ActiveCell.Width <> points) And (count < 20)
If ActiveCell.Width < points Then
lowerwidth = curwidth
Selection.ColumnWidth = (curwidth + upwidth) / 2
Else
upwidth = curwidth
Selection.ColumnWidth = (curwidth + lowerwidth) / 2
End If
curwidth = ActiveCell.ColumnWidth
count = count + 1
Wend
End Sub
Ton code est bon. Sauf que ton code a des lignes qui sont coupées au mauvais endroit. Tu trouveras la même procédure avec les petites corrections dans le module 1 du fichier suivant : http://cjoint.com/?chpVAvkcLh
"sasha" a écrit dans le message de news:
ouops j'ai oublie la maco : Sub colonnesEnCentimetres() Dim cm As Integer, points As Integer, savewidth As Integer Dim count As Integer Application.ScreenUpdating = False cm = Application.InputBox("entrer la largeur de la colonne en cms", "Largeur de la colonne souhaitée", Type:=1) If cm = False Then Exit Sub points = Application.CentimetersToPoints(cm) savewidth = ActiveCell.ColumnWidth ActiveCell.ColumnWidth = 255 If points > ActiveCell.Width Then MsgBox "la largeur de" & cm & "est trop large" & Chr(10) & _ "la valeur maxi est de " & _ Format(ActiveCell.Width / 28.3464566929134, _ "0.00"), vbOKOnly + vbExclamation, "largeur non valable" ActiveCell.ColumnWidth = savewidth Exit Sub End If lowerwidth = 0 upwidth = 255 ActiveCell.ColumnWidth = 127.5 curwidth = ActiveCell.ColumnWidth count = 0 While (ActiveCell.Width <> points) And (count < 20) If ActiveCell.Width < points Then lowerwidth = curwidth Selection.ColumnWidth = (curwidth + upwidth) / 2 Else upwidth = curwidth Selection.ColumnWidth = (curwidth + lowerwidth) / 2 End If curwidth = ActiveCell.ColumnWidth count = count + 1 Wend End Sub
-- sasha
sasha
Excuses moi d'insister (je t'ai envoyé au mail sur ton adresse hotmail), mais ds le fichier cjoint.com il n'y a pas de module 1 .. -- sasha
Ton code est bon. Sauf que ton code a des lignes qui sont coupées au mauvais endroit. Tu trouveras la même procédure avec les petites corrections dans le module 1 du fichier suivant : http://cjoint.com/?chpVAvkcLh
"sasha" a écrit dans le message de news:
ouops j'ai oublie la maco : Sub colonnesEnCentimetres() Dim cm As Integer, points As Integer, savewidth As Integer Dim count As Integer Application.ScreenUpdating = False cm = Application.InputBox("entrer la largeur de la colonne en cms", "Largeur de la colonne souhaitée", Type:=1) If cm = False Then Exit Sub points = Application.CentimetersToPoints(cm) savewidth = ActiveCell.ColumnWidth ActiveCell.ColumnWidth = 255 If points > ActiveCell.Width Then MsgBox "la largeur de" & cm & "est trop large" & Chr(10) & _ "la valeur maxi est de " & _ Format(ActiveCell.Width / 28.3464566929134, _ "0.00"), vbOKOnly + vbExclamation, "largeur non valable" ActiveCell.ColumnWidth = savewidth Exit Sub End If lowerwidth = 0 upwidth = 255 ActiveCell.ColumnWidth = 127.5 curwidth = ActiveCell.ColumnWidth count = 0 While (ActiveCell.Width <> points) And (count < 20) If ActiveCell.Width < points Then lowerwidth = curwidth Selection.ColumnWidth = (curwidth + upwidth) / 2 Else upwidth = curwidth Selection.ColumnWidth = (curwidth + lowerwidth) / 2 End If curwidth = ActiveCell.ColumnWidth count = count + 1 Wend End Sub
-- sasha
Excuses moi d'insister (je t'ai envoyé au mail sur ton adresse hotmail), mais
ds le fichier cjoint.com il n'y a pas de module 1 ..
--
sasha
Ton code est bon. Sauf que ton code a des lignes qui sont coupées
au mauvais endroit. Tu trouveras la même procédure avec les
petites corrections dans le module 1 du fichier suivant :
http://cjoint.com/?chpVAvkcLh
"sasha" <sasha@discussions.microsoft.com> a écrit dans le message de news:
F44B17A5-201D-433C-BC7B-F3249A143687@microsoft.com...
ouops j'ai oublie la maco :
Sub colonnesEnCentimetres()
Dim cm As Integer, points As Integer, savewidth As Integer
Dim count As Integer
Application.ScreenUpdating = False
cm = Application.InputBox("entrer la largeur de la colonne en cms",
"Largeur de la colonne souhaitée", Type:=1)
If cm = False Then Exit Sub
points = Application.CentimetersToPoints(cm)
savewidth = ActiveCell.ColumnWidth
ActiveCell.ColumnWidth = 255
If points > ActiveCell.Width Then
MsgBox "la largeur de" & cm & "est trop large" & Chr(10) &
_
"la valeur maxi est de " & _
Format(ActiveCell.Width / 28.3464566929134, _
"0.00"), vbOKOnly + vbExclamation, "largeur non valable"
ActiveCell.ColumnWidth = savewidth
Exit Sub
End If
lowerwidth = 0
upwidth = 255
ActiveCell.ColumnWidth = 127.5
curwidth = ActiveCell.ColumnWidth
count = 0
While (ActiveCell.Width <> points) And (count < 20)
If ActiveCell.Width < points Then
lowerwidth = curwidth
Selection.ColumnWidth = (curwidth + upwidth) / 2
Else
upwidth = curwidth
Selection.ColumnWidth = (curwidth + lowerwidth) / 2
End If
curwidth = ActiveCell.ColumnWidth
count = count + 1
Wend
End Sub
Excuses moi d'insister (je t'ai envoyé au mail sur ton adresse hotmail), mais ds le fichier cjoint.com il n'y a pas de module 1 .. -- sasha
Ton code est bon. Sauf que ton code a des lignes qui sont coupées au mauvais endroit. Tu trouveras la même procédure avec les petites corrections dans le module 1 du fichier suivant : http://cjoint.com/?chpVAvkcLh
"sasha" a écrit dans le message de news:
ouops j'ai oublie la maco : Sub colonnesEnCentimetres() Dim cm As Integer, points As Integer, savewidth As Integer Dim count As Integer Application.ScreenUpdating = False cm = Application.InputBox("entrer la largeur de la colonne en cms", "Largeur de la colonne souhaitée", Type:=1) If cm = False Then Exit Sub points = Application.CentimetersToPoints(cm) savewidth = ActiveCell.ColumnWidth ActiveCell.ColumnWidth = 255 If points > ActiveCell.Width Then MsgBox "la largeur de" & cm & "est trop large" & Chr(10) & _ "la valeur maxi est de " & _ Format(ActiveCell.Width / 28.3464566929134, _ "0.00"), vbOKOnly + vbExclamation, "largeur non valable" ActiveCell.ColumnWidth = savewidth Exit Sub End If lowerwidth = 0 upwidth = 255 ActiveCell.ColumnWidth = 127.5 curwidth = ActiveCell.ColumnWidth count = 0 While (ActiveCell.Width <> points) And (count < 20) If ActiveCell.Width < points Then lowerwidth = curwidth Selection.ColumnWidth = (curwidth + upwidth) / 2 Else upwidth = curwidth Selection.ColumnWidth = (curwidth + lowerwidth) / 2 End If curwidth = ActiveCell.ColumnWidth count = count + 1 Wend End Sub
-- sasha
MichDenis
Désolé, regarde là : http://cjoint.com/?cpnXxw3OtB
"sasha" a écrit dans le message de news:
Excuses moi d'insister (je t'ai envoyé au mail sur ton adresse hotmail), mais ds le fichier cjoint.com il n'y a pas de module 1 .. -- sasha
Ton code est bon. Sauf que ton code a des lignes qui sont coupées au mauvais endroit. Tu trouveras la même procédure avec les petites corrections dans le module 1 du fichier suivant : http://cjoint.com/?chpVAvkcLh
"sasha" a écrit dans le message de news:
ouops j'ai oublie la maco : Sub colonnesEnCentimetres() Dim cm As Integer, points As Integer, savewidth As Integer Dim count As Integer Application.ScreenUpdating = False cm = Application.InputBox("entrer la largeur de la colonne en cms", "Largeur de la colonne souhaitée", Type:=1) If cm = False Then Exit Sub points = Application.CentimetersToPoints(cm) savewidth = ActiveCell.ColumnWidth ActiveCell.ColumnWidth = 255 If points > ActiveCell.Width Then MsgBox "la largeur de" & cm & "est trop large" & Chr(10) & _ "la valeur maxi est de " & _ Format(ActiveCell.Width / 28.3464566929134, _ "0.00"), vbOKOnly + vbExclamation, "largeur non valable" ActiveCell.ColumnWidth = savewidth Exit Sub End If lowerwidth = 0 upwidth = 255 ActiveCell.ColumnWidth = 127.5 curwidth = ActiveCell.ColumnWidth count = 0 While (ActiveCell.Width <> points) And (count < 20) If ActiveCell.Width < points Then lowerwidth = curwidth Selection.ColumnWidth = (curwidth + upwidth) / 2 Else upwidth = curwidth Selection.ColumnWidth = (curwidth + lowerwidth) / 2 End If curwidth = ActiveCell.ColumnWidth count = count + 1 Wend End Sub
-- sasha
Désolé, regarde là :
http://cjoint.com/?cpnXxw3OtB
"sasha" <sasha@discussions.microsoft.com> a écrit dans le message de news:
60A3335D-7F46-4323-840B-4752BC30B60F@microsoft.com...
Excuses moi d'insister (je t'ai envoyé au mail sur ton adresse hotmail), mais
ds le fichier cjoint.com il n'y a pas de module 1 ..
--
sasha
Ton code est bon. Sauf que ton code a des lignes qui sont coupées
au mauvais endroit. Tu trouveras la même procédure avec les
petites corrections dans le module 1 du fichier suivant :
http://cjoint.com/?chpVAvkcLh
"sasha" <sasha@discussions.microsoft.com> a écrit dans le message de news:
F44B17A5-201D-433C-BC7B-F3249A143687@microsoft.com...
ouops j'ai oublie la maco :
Sub colonnesEnCentimetres()
Dim cm As Integer, points As Integer, savewidth As Integer
Dim count As Integer
Application.ScreenUpdating = False
cm = Application.InputBox("entrer la largeur de la colonne en cms",
"Largeur de la colonne souhaitée", Type:=1)
If cm = False Then Exit Sub
points = Application.CentimetersToPoints(cm)
savewidth = ActiveCell.ColumnWidth
ActiveCell.ColumnWidth = 255
If points > ActiveCell.Width Then
MsgBox "la largeur de" & cm & "est trop large" & Chr(10) &
_
"la valeur maxi est de " & _
Format(ActiveCell.Width / 28.3464566929134, _
"0.00"), vbOKOnly + vbExclamation, "largeur non valable"
ActiveCell.ColumnWidth = savewidth
Exit Sub
End If
lowerwidth = 0
upwidth = 255
ActiveCell.ColumnWidth = 127.5
curwidth = ActiveCell.ColumnWidth
count = 0
While (ActiveCell.Width <> points) And (count < 20)
If ActiveCell.Width < points Then
lowerwidth = curwidth
Selection.ColumnWidth = (curwidth + upwidth) / 2
Else
upwidth = curwidth
Selection.ColumnWidth = (curwidth + lowerwidth) / 2
End If
curwidth = ActiveCell.ColumnWidth
count = count + 1
Wend
End Sub
Désolé, regarde là : http://cjoint.com/?cpnXxw3OtB
"sasha" a écrit dans le message de news:
Excuses moi d'insister (je t'ai envoyé au mail sur ton adresse hotmail), mais ds le fichier cjoint.com il n'y a pas de module 1 .. -- sasha
Ton code est bon. Sauf que ton code a des lignes qui sont coupées au mauvais endroit. Tu trouveras la même procédure avec les petites corrections dans le module 1 du fichier suivant : http://cjoint.com/?chpVAvkcLh
"sasha" a écrit dans le message de news:
ouops j'ai oublie la maco : Sub colonnesEnCentimetres() Dim cm As Integer, points As Integer, savewidth As Integer Dim count As Integer Application.ScreenUpdating = False cm = Application.InputBox("entrer la largeur de la colonne en cms", "Largeur de la colonne souhaitée", Type:=1) If cm = False Then Exit Sub points = Application.CentimetersToPoints(cm) savewidth = ActiveCell.ColumnWidth ActiveCell.ColumnWidth = 255 If points > ActiveCell.Width Then MsgBox "la largeur de" & cm & "est trop large" & Chr(10) & _ "la valeur maxi est de " & _ Format(ActiveCell.Width / 28.3464566929134, _ "0.00"), vbOKOnly + vbExclamation, "largeur non valable" ActiveCell.ColumnWidth = savewidth Exit Sub End If lowerwidth = 0 upwidth = 255 ActiveCell.ColumnWidth = 127.5 curwidth = ActiveCell.ColumnWidth count = 0 While (ActiveCell.Width <> points) And (count < 20) If ActiveCell.Width < points Then lowerwidth = curwidth Selection.ColumnWidth = (curwidth + upwidth) / 2 Else upwidth = curwidth Selection.ColumnWidth = (curwidth + lowerwidth) / 2 End If curwidth = ActiveCell.ColumnWidth count = count + 1 Wend End Sub
-- sasha
sasha
merci ça marche !! -- sasha
Désolé, regarde là : http://cjoint.com/?cpnXxw3OtB
"sasha" a écrit dans le message de news:
Excuses moi d'insister (je t'ai envoyé au mail sur ton adresse hotmail), mais ds le fichier cjoint.com il n'y a pas de module 1 .. -- sasha
Ton code est bon. Sauf que ton code a des lignes qui sont coupées au mauvais endroit. Tu trouveras la même procédure avec les petites corrections dans le module 1 du fichier suivant : http://cjoint.com/?chpVAvkcLh
"sasha" a écrit dans le message de news:
ouops j'ai oublie la maco : Sub colonnesEnCentimetres() Dim cm As Integer, points As Integer, savewidth As Integer Dim count As Integer Application.ScreenUpdating = False cm = Application.InputBox("entrer la largeur de la colonne en cms", "Largeur de la colonne souhaitée", Type:=1) If cm = False Then Exit Sub points = Application.CentimetersToPoints(cm) savewidth = ActiveCell.ColumnWidth ActiveCell.ColumnWidth = 255 If points > ActiveCell.Width Then MsgBox "la largeur de" & cm & "est trop large" & Chr(10) & _ "la valeur maxi est de " & _ Format(ActiveCell.Width / 28.3464566929134, _ "0.00"), vbOKOnly + vbExclamation, "largeur non valable" ActiveCell.ColumnWidth = savewidth Exit Sub End If lowerwidth = 0 upwidth = 255 ActiveCell.ColumnWidth = 127.5 curwidth = ActiveCell.ColumnWidth count = 0 While (ActiveCell.Width <> points) And (count < 20) If ActiveCell.Width < points Then lowerwidth = curwidth Selection.ColumnWidth = (curwidth + upwidth) / 2 Else upwidth = curwidth Selection.ColumnWidth = (curwidth + lowerwidth) / 2 End If curwidth = ActiveCell.ColumnWidth count = count + 1 Wend End Sub
-- sasha
merci ça marche !!
--
sasha
Désolé, regarde là :
http://cjoint.com/?cpnXxw3OtB
"sasha" <sasha@discussions.microsoft.com> a écrit dans le message de news:
60A3335D-7F46-4323-840B-4752BC30B60F@microsoft.com...
Excuses moi d'insister (je t'ai envoyé au mail sur ton adresse hotmail), mais
ds le fichier cjoint.com il n'y a pas de module 1 ..
--
sasha
Ton code est bon. Sauf que ton code a des lignes qui sont coupées
au mauvais endroit. Tu trouveras la même procédure avec les
petites corrections dans le module 1 du fichier suivant :
http://cjoint.com/?chpVAvkcLh
"sasha" <sasha@discussions.microsoft.com> a écrit dans le message de news:
F44B17A5-201D-433C-BC7B-F3249A143687@microsoft.com...
ouops j'ai oublie la maco :
Sub colonnesEnCentimetres()
Dim cm As Integer, points As Integer, savewidth As Integer
Dim count As Integer
Application.ScreenUpdating = False
cm = Application.InputBox("entrer la largeur de la colonne en cms",
"Largeur de la colonne souhaitée", Type:=1)
If cm = False Then Exit Sub
points = Application.CentimetersToPoints(cm)
savewidth = ActiveCell.ColumnWidth
ActiveCell.ColumnWidth = 255
If points > ActiveCell.Width Then
MsgBox "la largeur de" & cm & "est trop large" & Chr(10) &
_
"la valeur maxi est de " & _
Format(ActiveCell.Width / 28.3464566929134, _
"0.00"), vbOKOnly + vbExclamation, "largeur non valable"
ActiveCell.ColumnWidth = savewidth
Exit Sub
End If
lowerwidth = 0
upwidth = 255
ActiveCell.ColumnWidth = 127.5
curwidth = ActiveCell.ColumnWidth
count = 0
While (ActiveCell.Width <> points) And (count < 20)
If ActiveCell.Width < points Then
lowerwidth = curwidth
Selection.ColumnWidth = (curwidth + upwidth) / 2
Else
upwidth = curwidth
Selection.ColumnWidth = (curwidth + lowerwidth) / 2
End If
curwidth = ActiveCell.ColumnWidth
count = count + 1
Wend
End Sub
Désolé, regarde là : http://cjoint.com/?cpnXxw3OtB
"sasha" a écrit dans le message de news:
Excuses moi d'insister (je t'ai envoyé au mail sur ton adresse hotmail), mais ds le fichier cjoint.com il n'y a pas de module 1 .. -- sasha
Ton code est bon. Sauf que ton code a des lignes qui sont coupées au mauvais endroit. Tu trouveras la même procédure avec les petites corrections dans le module 1 du fichier suivant : http://cjoint.com/?chpVAvkcLh
"sasha" a écrit dans le message de news:
ouops j'ai oublie la maco : Sub colonnesEnCentimetres() Dim cm As Integer, points As Integer, savewidth As Integer Dim count As Integer Application.ScreenUpdating = False cm = Application.InputBox("entrer la largeur de la colonne en cms", "Largeur de la colonne souhaitée", Type:=1) If cm = False Then Exit Sub points = Application.CentimetersToPoints(cm) savewidth = ActiveCell.ColumnWidth ActiveCell.ColumnWidth = 255 If points > ActiveCell.Width Then MsgBox "la largeur de" & cm & "est trop large" & Chr(10) & _ "la valeur maxi est de " & _ Format(ActiveCell.Width / 28.3464566929134, _ "0.00"), vbOKOnly + vbExclamation, "largeur non valable" ActiveCell.ColumnWidth = savewidth Exit Sub End If lowerwidth = 0 upwidth = 255 ActiveCell.ColumnWidth = 127.5 curwidth = ActiveCell.ColumnWidth count = 0 While (ActiveCell.Width <> points) And (count < 20) If ActiveCell.Width < points Then lowerwidth = curwidth Selection.ColumnWidth = (curwidth + upwidth) / 2 Else upwidth = curwidth Selection.ColumnWidth = (curwidth + lowerwidth) / 2 End If curwidth = ActiveCell.ColumnWidth count = count + 1 Wend End Sub