Page 1 of 1

เปิดไฟล์ excel แล้วให้ ปุ่ม button 22 enabled ครับ

Posted: Mon May 18, 2020 12:51 am
by yodpao.b
0.JPG
จากรูป บน เปิดไฟล์ excel แล้วให้ ปุ่ม button 22 ที่อยู่ใน sheet enabled ครับ

ปุ่มbutton 22 สร้างจาก ดังรูปด้านล่าง
1.JPG
code ที่ใช้ ว่างอยู่ใน ThisWorkbook ครับ

Code: Select all

Option Explicit

Private Sub Workbook_Open()
    Me.Shapes("Button 24").ControlFormat.Enabled = False

'    Set b1 = ActiveSheet.Buttons("Button 24")
'    b1.Enabled = False

End Sub
มันไม่ทำงานครับ
ต้องแก้อย่างไรครับ

Re: เปิดไฟล์ excel แล้วให้ ปุ่ม button 22 enabled ครับ

Posted: Mon May 18, 2020 1:56 am
by yodpao.b
ไม่ต้องแล้วครับ
ผมใช้ CommandButton แทนครับ

ขอบคุณครับ