:D snasui.com ยินดีต้อนรับ :D
ยินดีต้อนรับสู่กระดานถามตอบ Excel and VBA และอื่น ๆ ที่เป็นมิตรกับทุกท่าน มีไฟล์แนบมหาศาล ช่วยให้ท่านค้นหาและติดตามศึกษาได้โดยง่าย :thup: สมาชิกท่านใดที่ยังไม่ได้ระบุ Version ของ Excel ที่ใช้งานจริง สามารถทำตาม Link นี้เพื่อจะได้รับคำตอบที่ตรงกับ Version ของท่านครับ :arrow: ระบุ Version ของ Excel
:!: โปรดทราบ :!:
  1. กรุณาอ่านกฎการใช้บอร์ด (Forum rules) ในตำแหน่งด้านบนของแต่ละบอร์ด
  2. การสมัครสมาชิก การ Login การกู้คืนรหัสผ่าน
    1. สมัครสมาชิกดูขั้นตอนได้ที่ :arrow: สมัครสมาชิก
    2. Login เข้าระบบโดยคลิกปุ่ม Login ตรงมุมขวาบนของหน้านี้ :roll:
    3. การ Login ผ่าน Facebook ดูวิธีที่ :arrow: Login ผ่าน Facebook
    4. ลืมรหัสผ่านสามารถรับรหัสใหม่ได้ที่ :arrow: Reset รหัสผ่าน
  3. มีปัญหาการใช้งาน แจ้งผู้ดูแลระบบได้ที่ :arrow: ติดต่อผู้ดูแลระบบ
  4. กำหนดการตั้งค่าส่วนตัว เช่นตั้งค่าภาษาเป็นไทยหรืออังกฤษดูได้ที่ :arrow: ตั้งค่าส่วนตัว
  5. การตั้งและตอบกระทู้ดูได้ที่ :arrow: วิธีการตั้งและตอบกระทู้
  6. การจัดรูปแบบตัวอักษรด้วย bbcode ในช่องแสดงความคิดเห็นดูได้ที่ :arrow: จัดรูปแบบตัวอักษร
  7. กำหนดขนาดตัวอักษรใน Browser ดูได้ที่ :arrow: กำหนดขนาดตัวอักษรใน Browser

ใช้ SpinButton ผล update ช้อมูลลงผิดช่องครับ

ฟอรัมถาม-ตอบปัญหาการใช้งานสูตรและฟังก์ชัน Excel
Forum rules
  1. ไม่อนุญาตให้ใช้ภาษาแชทในการถามและตอบปัญหา ไม่ใช้คำว่า "คับ" หรือ "อ่ะครับ" แทนคำว่า "ครับ" ไม่ใช้คำว่า "เด๋ว" แทนคำว่า "เดี๋ยว" เป็นต้น เนื่องจากเมื่อแปลเป็นภาษาต่างประเทศแล้วจะให้ความหมายผิดไปจากที่ควรจะเป็น
  2. ห้ามถามโดยระบุชื่อผู้ตอบและต้องตั้งชื่อกระทู้ให้สื่อถึงปัญหาที่จะถาม ไม่ตั้งชื่อว่า ช่วยด้วยครับ, มีปัญหามาปรึกษาครับ เป็นต้น
  3. กรุณาอธิบายปัญหาและระบุคำตอบที่ต้องการมาในกระทู้ด้วยเสมอถึงแม้จะอธิบายไว้ในไฟล์แนบแล้วก็ตาม ทั้งนี้เพื่ออำนวยความสะดวกแก่เพื่อนสมาชิกในการค้นหาข้อมูล
  4. กรุณาแนบไฟล์ตัวอย่างพร้อมแสดงคำตอบที่ถูกต้องมาในไฟล์ด้วยเพื่อให้ง่ายต่อการทำความเข้าใจและสะดวกต่อการตอบคำถาม (ขนาดไฟล์ไม่เกิน 500Kb ขนาดภาพไม่เกิน 800*600 Pixel) ไม่แนบเป็น Link มาจากแหล่งอื่นที่อาจจะถูกลบทิ้งไปโดยต้นทางในภายหลัง นอกจากนี้ไม่ควรแนบไฟล์ที่มีข้อมูลสำคัญอันก่อให้เกิดความเสียหายกับตนเองและผู้อื่น
  5. กรณีเป็นคำถามเกี่ยวกับ Programming เช่น VBA, VB.Net, C#, SQL ฯลฯ ต้องลองเขียนมาเองก่อนเสมอ ถามเฉพาะที่ติดปัญหา ระบุ Module, Procedure ที่ติดปัญหาให้ชัดเจน กรุณาโพสต์ Code ให้แสดงเป็น Code คือเปิดด้วย [code] และปิดด้วย [/code] ตัวอย่างเช่น [code]dim r as range[/code] เพื่อให้แตกต่างจากข้อความทั่วไป สะดวกในการอ่านและทดสอบ (คลิกเพื่อดูตัวอย่าง)
  6. กรุณาแจ้งผลการใช้งานเมื่อได้รับคำตอบว่าตรงกับความต้องการหรือไม่
yodpao.b
Gold
Gold
Posts: 1608
Joined: Tue Jul 19, 2011 2:47 pm
Excel Ver: 2013,excel standard

ใช้ SpinButton ผล update ช้อมูลลงผิดช่องครับ

#1

Post by yodpao.b »

ใช้ SpinButton ผล update ช้อมูลลงผิดช่องครับ
ต้องการให้ ในช่อง เป้าหมายและผลประหยัด update ข้อมูลลงช่องที่ถูกต้องครับ
เช่น
เป้าหมาย 2561 ลงในคอลัม I
เป้าหมาย 2562 ลงในคอลัม j
เป้าหมาย 2563 ลงในคอลัม k
ทั้งนี้ ต้องเลื่อน SpinButton ไปยัง พศ 2566 และแก้ไขตัวเลยดังรูป ที่ 1
ทำตามลูกสอนแดงและแก้ตามสีเหลืองครับ
แล้วจึง กดปุ่ม update
Capture3.JPG
ผลที่ได้ในรูปด้านล่าง
Capture2.JPG
จริงๆแล้วในช่องคอลัม I J K ต้องไม่เปลี่ยนแปลง
แต่จะไปเปลี่ยนในช่อง L M N ครับดังรูปด้านล่าง
Capture1.JPG
ไฟล์ส่งไม่ได้ครับ
เดียวล่งใหใหม่
You do not have the required permissions to view the files attached to this post.
yodpao.b
Gold
Gold
Posts: 1608
Joined: Tue Jul 19, 2011 2:47 pm
Excel Ver: 2013,excel standard

Re: ใช้ SpinButton ผล update ช้อมูลลงผิดช่องครับ

#2

Post by yodpao.b »

ส่งไฟล
You do not have the required permissions to view the files attached to this post.
yodpao.b
Gold
Gold
Posts: 1608
Joined: Tue Jul 19, 2011 2:47 pm
Excel Ver: 2013,excel standard

Re: ใช้ SpinButton ผล update ช้อมูลลงผิดช่องครับ

#3

Post by yodpao.b »

code ที่ใช้

Code: Select all

Private Sub CommandButton2_Click()
'»ØèÁ Update

If Me.cmbslno.Value = "" Then
MsgBox "ID No Can Not be Blank!!!", vbExclamation, "SL No"
Exit Sub
End If
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim i As Integer
i = 0
Do While Not IsEmpty(Sheet15.Cells(4 + i, 1).Value)
    If Sheet15.Cells(4 + i, 1).Value = cmbslno.Text Then
          Sheet15.Cells(4 + i, 8).Value = Noname.Text & " " & Textname.Text
          Sheet15.Cells(4 + i, 9).Value = TextBox01.Text
          Sheet15.Cells(4 + i, 10).Value = TextBox02.Text
          Sheet15.Cells(4 + i, 11).Value = TextBox03.Text
          Sheet15.Cells(4 + i, 15).Value = TextBox11.Text
          Sheet15.Cells(4 + i, 16).Value = TextBox12.Text
          Sheet15.Cells(4 + i, 17).Value = TextBox13.Text
          Sheet15.Cells(4 + i, 22).Value = ComboBox21.Text
          Sheet15.Cells(4 + i, 23).Value = ComboBox22.Text
          Sheet15.Cells(4 + i, 24).Value = ComboBox23.Text
                MsgBox "¨Ñ´à¡çºÅ§ã¹°Ò¹¢éÍÁÙÅàÃÕºÃéÍÂáÅéÇ"
        Exit Do
    End If
    i = i + 1
Loop

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim j, already As Integer
ListBox01.Clear
j = 0
Do While Not IsEmpty(Sheet15.Cells(4 + j, 8).Value)
    already = 0
    If Sheet15.Cells(4 + j, 3).Value = ComboBox02.Value Then
            If Sheet15.Cells(4 + j, 2).Value = ComboBox01.Value Then
                    ListBox01.AddItem Sheet15.Cells(4 + j, 8).Value
            End If
    End If
    j = j + 1
Loop

Call Blank

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
ComboBox21.Clear
ComboBox22.Clear
ComboBox23.Clear
Call open_comboBox2

End Sub
code ที่ทำงานให้ใส่ในช่อง

Code: Select all

Dim i As Integer
i = 0
Do While Not IsEmpty(Sheet15.Cells(4 + i, 1).Value)
    If Sheet15.Cells(4 + i, 1).Value = cmbslno.Text Then
          Sheet15.Cells(4 + i, 8).Value = Noname.Text & " " & Textname.Text
          Sheet15.Cells(4 + i, 9).Value = TextBox01.Text
          Sheet15.Cells(4 + i, 10).Value = TextBox02.Text
          Sheet15.Cells(4 + i, 11).Value = TextBox03.Text
          Sheet15.Cells(4 + i, 15).Value = TextBox11.Text
          Sheet15.Cells(4 + i, 16).Value = TextBox12.Text
          Sheet15.Cells(4 + i, 17).Value = TextBox13.Text
          Sheet15.Cells(4 + i, 22).Value = ComboBox21.Text
          Sheet15.Cells(4 + i, 23).Value = ComboBox22.Text
          Sheet15.Cells(4 + i, 24).Value = ComboBox23.Text
                MsgBox "¨Ñ´à¡çºÅ§ã¹°Ò¹¢éÍÁÙÅàÃÕºÃéÍÂáÅéÇ"
        Exit Do
    End If
    i = i + 1
Loop
ผมไม่เข้าว่าจะทำอย่างไรให้ textbox รู้ว่าควรใส่ตาม พศ.ครับ
User avatar
snasui
Site Admin
Site Admin
Posts: 31257
Joined: Sun Jan 24, 2010 12:33 pm
Location: Songkhla, Thailand
Excel Ver: 2010, 2019
Contact:

Re: ใช้ SpinButton ผล update ช้อมูลลงผิดช่องครับ

#4

Post by snasui »

:D ช่วยยกตัวอย่างข้อมูลที่ต้องกรอกใน UserForm, Object ที่ผู้ใช้จะต้องคลิก และผลลัพธ์ที่ต้องการ จะได้สะดวกกับผู้ตอบในการทำตามขั้นตอนและสังเกตการทำงานของ Code ครับ
yodpao.b
Gold
Gold
Posts: 1608
Joined: Tue Jul 19, 2011 2:47 pm
Excel Ver: 2013,excel standard

Re: ใช้ SpinButton ผล update ช้อมูลลงผิดช่องครับ

#5

Post by yodpao.b »

ยกตัวอย่างข้อมูลที่ต้องกรอกใน UserForm, Object ที่ผู้ใช้จะต้องคลิก
1.JPG
ดูที่ sheet data เพื่อดูการเปลี่ยนแปลงดังรูปบนตามสีเหลือง
เปิด UserForm1
2.JPG
เลือกObjectดังนี้ดังรูปบน
3.JPG
สังเกตุ , แล้วเลือกลูกศรจนเห็นปี 2566

ขอขึ้นโพสตใหม่ครับ add รูปไมได้
You do not have the required permissions to view the files attached to this post.
yodpao.b
Gold
Gold
Posts: 1608
Joined: Tue Jul 19, 2011 2:47 pm
Excel Ver: 2013,excel standard

Re: ใช้ SpinButton ผล update ช้อมูลลงผิดช่องครับ

#6

Post by yodpao.b »

4.JPG
แก้ไขดังรูปด้านบน
คลิกปุ่ม update และ cancel
จนขั้นตอนการเลือก
ผลที่ได้ดังรูปด้านล่าง ซึ่งผิด
5.JPG
ตัดเลข 10 ควรขึ้นในปี 2564 , 2565 , 2566
และในช่อง 2561 2562 2563 ควรเป็นค่าเดิมตามรูปด้านบนสุด

รูปแแบบหรือความต้องการที่ถูกต้องตามรูปด้านล่าง
6.JPG
You do not have the required permissions to view the files attached to this post.
yodpao.b
Gold
Gold
Posts: 1608
Joined: Tue Jul 19, 2011 2:47 pm
Excel Ver: 2013,excel standard

Re: ใช้ SpinButton ผล update ช้อมูลลงผิดช่องครับ

#7

Post by yodpao.b »

4.JPG
แก้ไขดังรูปด้านบน
คลิกปุ่ม update และ cancel
จนขั้นตอนการเลือก
ผลที่ได้ดังรูปด้านล่าง ซึ่งผิด
5.JPG

ตัดเลข 10 ควรขึ้นในปี 2564 , 2565 , 2566
และในช่อง 2561 2562 2563 ควรเป็นค่าเดิมตามรูปด้านบนสุด

รูปแแบบหรือความต้องการที่ถูกต้องตามรูปด้านล่าง
6.JPG
You do not have the required permissions to view the files attached to this post.
yodpao.b
Gold
Gold
Posts: 1608
Joined: Tue Jul 19, 2011 2:47 pm
Excel Ver: 2013,excel standard

Re: ใช้ SpinButton ผล update ช้อมูลลงผิดช่องครับ

#8

Post by yodpao.b »

#6 Post by yodpao.b » 24 May 2019 09:34
โฟตที่ 6 เรียงรูปผิดครับขอโทษ
User avatar
snasui
Site Admin
Site Admin
Posts: 31257
Joined: Sun Jan 24, 2010 12:33 pm
Location: Songkhla, Thailand
Excel Ver: 2010, 2019
Contact:

Re: ใช้ SpinButton ผล update ช้อมูลลงผิดช่องครับ

#9

Post by snasui »

:D ตัวอย่างการปรับ Code ครับ

ประกาศตัวแปร x เพิ่มด้านบนสุดจะได้เป็น

Code: Select all

Dim currow As Integer
Dim x As Integer
ปรับ Code ที่ Procedure pinButton1_Change จะได้เป็น

Code: Select all

Public Sub SpinButton1_Change()
'     curyear = SpinButton.Value
    x = Me.SpinButton1.Value - Me.SpinButton1.Min
     Label101.Caption = "พ.ศ." & SpinButton1.Value - 1
     Label102.Caption = "พ.ศ." & SpinButton1.Value
     Label103.Caption = "พ.ศ." & SpinButton1.Value + 1
    'Other code
ปรับ Code ที่ CommandButton2_Click จะได้เป็น

Code: Select all

Private Sub CommandButton2_Click()
'»ØèÁ Update

If Me.cmbslno.Value = "" Then
MsgBox "ID No Can Not be Blank!!!", vbExclamation, "SL No"
Exit Sub
End If
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim i As Integer
i = 0
Do While Not IsEmpty(Sheet15.Cells(4 + i, 1).Value)
    If Sheet15.Cells(4 + i, 1).Value = cmbslno.Text Then
          Sheet15.Cells(4 + i, 8).Value = Noname.Text & " " & Textname.Text
          Sheet15.Cells(4 + i, 9 + x).Value = TextBox01.Text
          Sheet15.Cells(4 + i, 10 + x).Value = TextBox02.Text
          Sheet15.Cells(4 + i, 11 + x).Value = TextBox03.Text
          'Other code
yodpao.b
Gold
Gold
Posts: 1608
Joined: Tue Jul 19, 2011 2:47 pm
Excel Ver: 2013,excel standard

Re: ใช้ SpinButton ผล update ช้อมูลลงผิดช่องครับ

#10

Post by yodpao.b »

ขอบคุณมากครับ
yodpao.b
Gold
Gold
Posts: 1608
Joined: Tue Jul 19, 2011 2:47 pm
Excel Ver: 2013,excel standard

Re: ใช้ SpinButton ผล update ช้อมูลลงผิดช่องครับ

#11

Post by yodpao.b »

ในกรณีที่เราเลือกชื่อใน List box
แล้วปรับ SpinButton ไปยัง ปี 2566

กลับไปเลือกรายการอื่นใน List box ใหม่อีกครั้งหนึ่ง
จะเห็นว่า SpinButton ไม่กลับมาอยู่ในสถานเดิม ตือ 2561
ต้องการให้ SpinButton กลับมาอยู่ในสถานะเดิม ตือ 2561
ผมใช้ SpinButton1.Default มัน bug
User avatar
snasui
Site Admin
Site Admin
Posts: 31257
Joined: Sun Jan 24, 2010 12:33 pm
Location: Songkhla, Thailand
Excel Ver: 2010, 2019
Contact:

Re: ใช้ SpinButton ผล update ช้อมูลลงผิดช่องครับ

#12

Post by snasui »

:D จะให้มันกลับไปเหมือนเดิมก็ต้องทำการ Reset มันใหม่ด้วย Event ของการคลิกรายการใน ListBox ครับ
yodpao.b
Gold
Gold
Posts: 1608
Joined: Tue Jul 19, 2011 2:47 pm
Excel Ver: 2013,excel standard

Re: ใช้ SpinButton ผล update ช้อมูลลงผิดช่องครับ

#13

Post by yodpao.b »

ใช้ code อะไรครับ
User avatar
snasui
Site Admin
Site Admin
Posts: 31257
Joined: Sun Jan 24, 2010 12:33 pm
Location: Songkhla, Thailand
Excel Ver: 2010, 2019
Contact:

Re: ใช้ SpinButton ผล update ช้อมูลลงผิดช่องครับ

#14

Post by snasui »

:lol: ผมไม่ตอบเป็น Code อยู่แล้วครับ ยกเว้นเขียนมาแล้วให้ช่วยดูให้ครับ
yodpao.b
Gold
Gold
Posts: 1608
Joined: Tue Jul 19, 2011 2:47 pm
Excel Ver: 2013,excel standard

Re: ใช้ SpinButton ผล update ช้อมูลลงผิดช่องครับ

#15

Post by yodpao.b »

เปิด UserForm1
ทำดตามรูปดังนี้
Capture1.JPG
Capture2.JPG
Capture3.JPG

Code: Select all

Private Sub ListBox01_Click()

    Dim i As Integer
    i = 0
    Do While Not IsEmpty(Sheet15.Cells(4 + i, 8).Value)
        If Sheet15.Cells(4 + i, 8).Value = ListBox01.Text Then
            cmbslno2.Text = Sheet15.Cells(4 + i, 4).Value
'            SpinButton1.Min = "2562"
'            goal(SpinButton1.Value - 2562) = 0
            Label101.Caption = "¾.È." & 2561
            Label102.Caption = "¾.È." & 2562
            Label103.Caption = "¾.È." & 2563
            Label111.Caption = "¾.È." & 2561
            Label112.Caption = "¾.È." & 2562
            Label113.Caption = "¾.È." & 2563
        
            Exit Do
        End If
    i = i + 1
    Loop
    
End Sub
You do not have the required permissions to view the files attached to this post.
yodpao.b
Gold
Gold
Posts: 1608
Joined: Tue Jul 19, 2011 2:47 pm
Excel Ver: 2013,excel standard

Re: ใช้ SpinButton ผล update ช้อมูลลงผิดช่องครับ

#16

Post by yodpao.b »

ไฟล
You do not have the required permissions to view the files attached to this post.
User avatar
snasui
Site Admin
Site Admin
Posts: 31257
Joined: Sun Jan 24, 2010 12:33 pm
Location: Songkhla, Thailand
Excel Ver: 2010, 2019
Contact:

Re: ใช้ SpinButton ผล update ช้อมูลลงผิดช่องครับ

#17

Post by snasui »

:D ตัวอย่างการปรับ Code ครับ

Code: Select all

Private Sub ListBox01_Click()
    Dim i As Integer
    i = 0
    SpinButton1.Value = SpinButton1.Min
    Label101.Caption = "¾.È." & SpinButton1.Min - 1
    Label102.Caption = "¾.È." & 2562
    Label103.Caption = "¾.È." & SpinButton1.Min + 1
    Label111.Caption = "¾.È." & SpinButton1.Min - 1
    Label112.Caption = "¾.È." & 2562
    Label113.Caption = "¾.È." & SpinButton1.Min + 1
    'Other code
    
yodpao.b
Gold
Gold
Posts: 1608
Joined: Tue Jul 19, 2011 2:47 pm
Excel Ver: 2013,excel standard

Re: ใช้ SpinButton ผล update ช้อมูลลงผิดช่องครับ

#18

Post by yodpao.b »

ขอบคุณมากครับ
ได้ตามต้องการครับ
yodpao.b
Gold
Gold
Posts: 1608
Joined: Tue Jul 19, 2011 2:47 pm
Excel Ver: 2013,excel standard

Re: ใช้ SpinButton ผล update ช้อมูลลงผิดช่องครับ

#19

Post by yodpao.b »

ต้องการ
ก่อนที่ทำการ Add . ให้ Noname.text(1.1.1) ตรวจสอบ ค่าในคอลัม F
ถ้าครงกันให้ไม่ add ถ้าไม่ตรงกันถึงaddได้
Capture4.JPG

Code: Select all

Private Sub CommandButton4_Click()
'ปุ่ม Add
On Error Resume Next
Dim i As Integer
Dim j As Integer
i = 0

If Me.cmbslno.Value = "" Or Me.Noname.Value = "" Or Me.Textname.Value = "" Then
MsgBox "ID Number Record Can Not be Blank!!!", vbExclamation, "ID Number"
     Exit Sub
End If
      
cmbslno1.Text = "E-" & Application.Text(Application.Max([max_no]) + 1, "0000")
cmbslno2.Text = Application.Max([max_no]) + 1
cmbslno.Text = cmbslno1.Text
      
Do While Not IsEmpty(Sheet15.Cells(3 + i, 6).Value)
    If Sheet15.Cells(3 + i, 6).Value <> Noname.Text Then
        Do
            If IsEmpty(Sheet15.Cells(3 + i, 1).Value) = False Then
                        i = i + 1
            End If
                Loop Until IsEmpty(Sheet15.Cells(3 + i, 1).Value) = True
                Sheet15.Cells(3 + i, 1).Value = cmbslno.Text
                Sheet15.Cells(3 + i, 2).Value = ComboBox01.Text
                Sheet15.Cells(3 + i, 3).Value = ComboBox02.Text
                Sheet15.Cells(3 + i, 4).Value = cmbslno2.Text
                Sheet15.Cells(3 + i, 5).Value = "-"
                Sheet15.Cells(3 + i, 6).Value = Noname.Text
                Sheet15.Cells(3 + i, 7).Value = Textname.Text
                Sheet15.Cells(3 + i, 8).Value = Noname.Text & " " & Textname.Text
                    For j = 0 To 5
                        Sheet15.Cells(3 + i, 9 + j).Value = goal(j)
                        Sheet15.Cells(3 + i, 15 + j).Value = actual(j)
                    Next j
                Sheet15.Cells(3 + i, 22).Value = ComboBox21.Text
                Sheet15.Cells(3 + i, 23).Value = ComboBox22.Text
                Sheet15.Cells(3 + i, 24).Value = ComboBox23.Text
                Call Blank
                Call ClearListBox01
                    MsgBox "จัดเก็บลงในฐานข้อมูลเรียบร้อยแล้ว"
            End If
    i = i + 1
Loop
    
'    CommandButton4.Enabled = False
'    CommandButton3.Enabled = True
'    CommandButton2.Enabled = True
'    CommandButton5.Enabled = True

End Sub
code นี้ทำงาน ไม่ตรวจสอบคาครับ
You do not have the required permissions to view the files attached to this post.
User avatar
snasui
Site Admin
Site Admin
Posts: 31257
Joined: Sun Jan 24, 2010 12:33 pm
Location: Songkhla, Thailand
Excel Ver: 2010, 2019
Contact:

Re: ใช้ SpinButton ผล update ช้อมูลลงผิดช่องครับ

#20

Post by snasui »

:D ตัวอย่าง Code ครับ

Code: Select all

Private Sub CommandButton4_Click()
    'ปุ่ม Add
    On Error Resume Next
    Dim i As Integer
    i = 0
    With Worksheets("Data")
        If Application.CountIf(.Range("f4", .Range("f" & .Rows.Count).End(xlUp)), _
            Me.Noname.Text) > 0 Then
            MsgBox "Please check sub item.", vbInformation
        End If
    End With
'Other code
Post Reply