|
>>
>>Sub ボタン1_click()
>> Response = MsgBox( _
>> Title:="新規ボタン作成の確認", _
>> Prompt:="新規ボタンを作成しますか?", _
>> Buttons:=vbYesNo + vbQuestion + vbDefaultButton2)
>> If Response = vbYes Then
>> ActiveSheet.Buttons.Add(200, 100, 80, 20).Select
>> NewButton = InputBox("新規シート名", "シート名入力")
>> Selection.Characters.Text = NewButton
>> End If
>> Selection.OnAction = "ジャンプ_click
>>End Sub
>>
>>Sub ジャンプ_click()
> Dim txt As String
txt = ActiveSheet.Buttons(Application.Caller).Caption
>> Sheets(Application.Caller).Select
>>End Sub
こっちの方が記述が短いかな?
|
|