Sub Creation_bouton() ' OK le 06/11/2024
'
Dim PosG As Integer
Dim PosH As Integer
Dim Hauteur As Integer
Dim Longueur As Integer
'
Application.StatusBar = "Mise En Place des Colonnes + Bouton OK..."
' on affiche les Choix pour les Colonnes
Call Col_Choi_Let
'
' on affiche les Choix pour les Colonnes
'Call Col_Verif_Let
dc = Sheets("TARIFS").Cells(1, Application.Columns.Count).End(xlToLeft).Column
col_bout3 = LetCol(dc + 3)
' col_bout2 = LetCol(dc + 3)
'
'Position fixe d'un bouton
'With ActiveSheet.Buttons
' .Add(10, 10, 10, 10).Select
' .OnAction = "NomdelaMacro"
' .Caption = "Bouton fixe"
'End With
'
' Position en fonction d'une cellule du "Bouton OK"
With Range(col_bout3 & "5")
PosG = .Left
PosH = .Top
Hauteur = 30 '.Height
Longueur = 100 '.Width
End With
With ActiveSheet.Buttons.Add(PosG, PosH, Longueur, Hauteur)
.OnAction = "Col_Verif_Let"
.Caption = "Bouton OK"
.Name = "Bouton pour OK"
With .Font
.Name = "Calibri"
.FontStyle = "Bold"
.Size = 14
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = 3 ' 1=Noir
End With
End With
' ##########################################
' PROBLÈME CI-DESSOUS
' ##########################################
' TEST En Cours le 01/07/2025...
'
' Position en fonction d'une cellule du "Bouton pour ECO SEUL"
With Range(col_bout3 & "9")
PosG = .Left
PosH = .Top
Hauteur = 30 '.Height
Longueur = 150 '.Width
End With
With ActiveSheet.Buttons.Add(PosG, PosH, Longueur, Hauteur)
.OnAction = "Col_Verif_Let_ECO"
.Caption = "Bouton Pour ECO SEUL"
.Name = "Bouton pour ECO SEUL"
With .Font
.Name = "Calibri"
.FontStyle = "Bold"
.Size = 14
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = 3 ' 1=Noir | 3=Rouge
End With
End With
'
' ##########################################
' PROBLÈME CI-DESSUS
' ##########################################
'
Application.ScreenUpdating = False
'
Range(LetCol(dc) & "2").Select
'
End Sub
'##########################################################
Function LetCol(NoCol) ' OK le 07/11/2024
LetCol = Split(Cells(1, NoCol).Address, "$")(1)
End Function
'##########################################################