Hi, I use this code as a routine to create buttons on workbook("meetpunten.xls").worksheets("sheet1")
Code
Public Sub ophalen_plaatsen_gegevens()
Application.ScreenUpdating = False
With Workbooks("meetpunten.xls").Worksheets("Sheet1")
'set de buttonname
strButtonname = .Range("a1").Range(varCeladres).Offset(0, 1).Value
'set de buttoncaption
strButtoncaption = .Range("a1").Range(varCeladres).Offset(0, 1).Value
End With
'plaatsen van nieuwe button
ActiveSheet.Buttons.Add(30, intXpositie, 100, 30).Select
'properties buttons
With Selection
.OnAction = "oproep_macro"
.Name = strButtonname
.Caption = strButtoncaption
'button niet mee verschalen bij aanpassen van rijhoogte en/of kolombreedte
.Placement = xlFreeFloating
.PrintObject = True
End With
'tekst properties buttoncaption
With Selection.Font
.Name = "Arial"
.FontStyle = "Vet"
.Size = 12
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleSingle
.ColorIndex = 11
End With
'x-positie aanpassen
intXpositie = intXpositie + 40
'uitlezen van overeenkomstige gegevens
Call ophalen_en_uitlezen_meetgegevens
Display More
I'm trying to find the syntax that returns the buttonname of the button the user clicked on. This seems easy but I don't know how?
Thanks,
Fluppe