Bonjour à tous,
Mon problème est que je ne connais pas le code pour activé un bouton sur VBA
j'ai bien essayé celui-là :
ActiveSheet.Shapes("Button 1").Select
Mais cela ne m'actionne pas la macros!!
Je vous toutes ma macro pour que vous puissiez voir dans quel contexte je cherche:
Sub ENVOIRDV()
'
' ENVOIRDV Macro
'
'
ActiveWindow.WindowState = xlNormal
Workbooks.Open Filename:= _
"C:\Documents and Settings\vincentb.SRV-MARTIN\Bureau\ISO MACROS\RDV PRIS.xlsm"
Sheets("Feuil1").Select
Rows("4:4").Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Windows("ISO2000.xlsm").Activate
Range("D4").Select
Selection.Copy
Windows("RDV PRIS.xlsm").Activate
Range("A4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Windows("ISO2000.xlsm").Activate
Range("D6").Select
Application.CutCopyMode = False
Selection.Copy
Windows("RDV PRIS.xlsm").Activate
Range("D4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Windows("ISO2000.xlsm").Activate
Range("D8").Select
Application.CutCopyMode = False
Selection.Copy
Windows("RDV PRIS.xlsm").Activate
Range("C4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Copy
Windows("RDV PRIS.xlsm").Activate
Range("I4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Windows("ISO2000.xlsm").Activate
Range("D12").Select
Application.CutCopyMode = False
Selection.Copy
Windows("RDV PRIS.xlsm").Activate
Range("E4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Windows("ISO2000.xlsm").Activate
Range("D14").Select
Application.CutCopyMode = False
Selection.Copy
Windows("RDV PRIS.xlsm").Activate
Range("F4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Windows("ISO2000.xlsm").Activate
Range("D16").Select
Application.CutCopyMode = False
Selection.Copy
Windows("RDV PRIS.xlsm").Activate
Range("G4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Windows("ISO2000.xlsm").Activate
Range("D18").Select
Application.CutCopyMode = False
Selection.Copy
Windows("RDV PRIS.xlsm").Activate
Range("H4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Windows("ISO2000.xlsm").Activate
Range("H4").Select
Application.CutCopyMode = False
Selection.Copy
Windows("RDV PRIS.xlsm").Activate
Range("J4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Windows("ISO2000.xlsm").Activate
Range("H6").Select
Application.CutCopyMode = False
Selection.Copy
Windows("RDV PRIS.xlsm").Activate
Range("K4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("A1").Select
Workbooks.Open Filename:= _
"C:\Documents and Settings\vincentb.SRV-MARTIN\Bureau\ISO MACROS\ENVOI RDV.xlsm"
Range("A8").Select
ActiveCell.FormulaR1C1 = _
"=CONCATENATE('[RDV PRIS.xlsm]Feuil1'!R1C13,"" "",'[RDV PRIS.xlsm]Feuil1'!R2C1,'[RDV PRIS.xlsm]Feuil1'!R4C1)"
Range("B8").Select
ActiveCell.FormulaR1C1 = _
"='[RDV PRIS.xlsm]Feuil1'!R4C10+'[RDV PRIS.xlsm]Feuil1'!R4C11"
Range("C8").Select
ActiveCell.FormulaR1C1 = "=30"
Range("D8").Select
ActiveCell.FormulaR1C1 = "='[RDV PRIS.xlsm]Feuil1'!R4C3"
ActiveSheet.Shapes("Button 1").Select
ActiveWorkbook.Save
ActiveWorkbook.Close
ActiveWorkbook.Save
ActiveWorkbook.Close
Windows("ISO2000.xlsm").Activate
ActiveWindow.WindowState = xlMaximized
End Sub
Est-ce que quelqu'un peut m'aider.
Mon problème est que je ne connais pas le code pour activé un bouton sur VBA
j'ai bien essayé celui-là :
ActiveSheet.Shapes("Button 1").Select
Mais cela ne m'actionne pas la macros!!
Je vous toutes ma macro pour que vous puissiez voir dans quel contexte je cherche:
Sub ENVOIRDV()
'
' ENVOIRDV Macro
'
'
ActiveWindow.WindowState = xlNormal
Workbooks.Open Filename:= _
"C:\Documents and Settings\vincentb.SRV-MARTIN\Bureau\ISO MACROS\RDV PRIS.xlsm"
Sheets("Feuil1").Select
Rows("4:4").Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Windows("ISO2000.xlsm").Activate
Range("D4").Select
Selection.Copy
Windows("RDV PRIS.xlsm").Activate
Range("A4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Windows("ISO2000.xlsm").Activate
Range("D6").Select
Application.CutCopyMode = False
Selection.Copy
Windows("RDV PRIS.xlsm").Activate
Range("D4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Windows("ISO2000.xlsm").Activate
Range("D8").Select
Application.CutCopyMode = False
Selection.Copy
Windows("RDV PRIS.xlsm").Activate
Range("C4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Copy
Windows("RDV PRIS.xlsm").Activate
Range("I4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Windows("ISO2000.xlsm").Activate
Range("D12").Select
Application.CutCopyMode = False
Selection.Copy
Windows("RDV PRIS.xlsm").Activate
Range("E4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Windows("ISO2000.xlsm").Activate
Range("D14").Select
Application.CutCopyMode = False
Selection.Copy
Windows("RDV PRIS.xlsm").Activate
Range("F4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Windows("ISO2000.xlsm").Activate
Range("D16").Select
Application.CutCopyMode = False
Selection.Copy
Windows("RDV PRIS.xlsm").Activate
Range("G4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Windows("ISO2000.xlsm").Activate
Range("D18").Select
Application.CutCopyMode = False
Selection.Copy
Windows("RDV PRIS.xlsm").Activate
Range("H4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Windows("ISO2000.xlsm").Activate
Range("H4").Select
Application.CutCopyMode = False
Selection.Copy
Windows("RDV PRIS.xlsm").Activate
Range("J4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Windows("ISO2000.xlsm").Activate
Range("H6").Select
Application.CutCopyMode = False
Selection.Copy
Windows("RDV PRIS.xlsm").Activate
Range("K4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("A1").Select
Workbooks.Open Filename:= _
"C:\Documents and Settings\vincentb.SRV-MARTIN\Bureau\ISO MACROS\ENVOI RDV.xlsm"
Range("A8").Select
ActiveCell.FormulaR1C1 = _
"=CONCATENATE('[RDV PRIS.xlsm]Feuil1'!R1C13,"" "",'[RDV PRIS.xlsm]Feuil1'!R2C1,'[RDV PRIS.xlsm]Feuil1'!R4C1)"
Range("B8").Select
ActiveCell.FormulaR1C1 = _
"='[RDV PRIS.xlsm]Feuil1'!R4C10+'[RDV PRIS.xlsm]Feuil1'!R4C11"
Range("C8").Select
ActiveCell.FormulaR1C1 = "=30"
Range("D8").Select
ActiveCell.FormulaR1C1 = "='[RDV PRIS.xlsm]Feuil1'!R4C3"
ActiveSheet.Shapes("Button 1").Select
ActiveWorkbook.Save
ActiveWorkbook.Close
ActiveWorkbook.Save
ActiveWorkbook.Close
Windows("ISO2000.xlsm").Activate
ActiveWindow.WindowState = xlMaximized
End Sub
Est-ce que quelqu'un peut m'aider.
Dernière édition: