salut Fanfan toutes mes excuses. Pour les messages d'avertissement du niveau de remplissage des tanks,
j'aimerais les avoir dans des formes(zone de texte) si possible, Pour le code je n'arrive pas exécuter ,
et je le comprend pas s'il vous plait pouvez vous m'éclairé un peu?.
Sub Rohnheam()
Dim i As Integer, i1, shp1, shp2
With Sheets("Feuil1")
Set c = .Range("C30")
Set shp1 = .Shapes.AddShape(msoShapeCan, c.Left, c.Top, 100, 200)
With shp1
.Adjustments.Item(1) = 0.1
Set shp2 = .Duplicate
shp2.Left = shp1.Left
shp2.Top = shp1.Top
shp2.Fill.ForeColor.RGB = 0
shp2.TextFrame2.TextRange.ParagraphFormat.Alignment = msoAlignCenter
End With
End With
For i1 = 0 To 200 Step 10
i = IIf(i1 <= 100, i1, WorksheetFunction.RandBetween(0, 100))
shp2.Top = shp1.Top + (100 - i) / 100 * shp1.Height
shp2.Height = shp1.Height * i / 100
shp2.TextFrame2.TextRange.Characters.Text = i
shp2.Fill.ForeColor.RGB = IIf(i < 20, RGB(0, 255, 0), IIf(i < 80, 0, RGB(255, 0, 0)))
Application.Wait Now + TimeSerial(0, 0, 2)
Next
End Sub