snasui.com ยินดีต้อนรับ ยินดีต้อนรับสู่กระดานถามตอบ Excel and VBA และอื่น ๆ ที่เป็นมิตรกับทุกท่าน มีไฟล์แนบมหาศาล ช่วยให้ท่านค้นหาและติดตามศึกษาได้โดยง่าย สมาชิกท่านใดที่ยังไม่ได้ระบุ Version ของ Excel ที่ใช้งานจริง สามารถทำตาม Link นี้เพื่อจะได้รับคำตอบที่ตรงกับ Version ของท่านครับ ระบุ Version ของ Excel
Private Sub CommandButton1_Click()
Dim ssheet As Worksheet
Set ssheet = ThisWorkbook.Sheets("database")
nr = ssheet.Cells(Rows.Count, 1).End(xlUp).Row + 1
ssheet.Cells(nr, 2) = Me.TextBox1
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Cell As Range
Application.EnableEvents = False
For Each Cell In Target
If Cell.Column = 2 Then
Cell.Offset(, 5).Value = Now
End If
If Cell.Column = 2 Then
Cell.Offset(, -1).Value = "CHM " & ((Year(Now) + 543 - 2500) * 10000) + (Range("A" & Rows.Count).End(xlUp).Row)
End If
Next Cell
Application.EnableEvents = True
End Sub
Private Sub CommandButton1_Click()
Dim ssheet As Worksheet
Set ssheet = ThisWorkbook.Sheets("database")
nr = ssheet.Cells(Rows.Count, 1).End(xlUp).Row + 1
ssheet.Cells(nr, 2) = Me.TextBox1
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Cell As Range
Application.EnableEvents = False
For Each Cell In Target
If Cell.Column = 2 Then
Cell.Offset(, 5).Value = Now
End If
If Cell.Column = 2 Then
Cell.Offset(, -1).Value = "CHM " & ((Year(Now) + 543 - 2500) * 10000) + (Range("A" & Rows.Count).End(xlUp).Row)
End If
Next Cell
Application.EnableEvents = True
End Sub
Private Sub CommandButton1_Click()
Dim c As Range
For Each c In Sheet3.Range("b2:b100").Cells
If TextBox1.Text = c.Value Then
Label1 = c.Offset(, -1).Value
End If
Next c
End Sub
Private Sub CommandButton1_Click()
Dim ssheet As Worksheet
Set ssheet = ThisWorkbook.Sheets("database")
nr = ssheet.Cells(Rows.Count, 1).End(xlUp).Row + 1
ssheet.Cells(nr, 2) = Me.TextBox1
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Cell As Range
Application.EnableEvents = False
For Each Cell In Target
If Cell.Column = 2 Then
Cell.Offset(, 5).Value = Now
End If
If Cell.Column = 2 Then
Cell.Offset(, -1).Value = "CHM " & ((Year(Now) + 543 - 2500) * 10000) + (Range("A" & Rows.Count).End(xlUp).Row)
End If
Next Cell
Application.EnableEvents = True
End Sub
Private Sub CommandButton1_Click()
Dim c As Range
For Each c In Sheet3.Range("b2:b100").Cells
If TextBox1.Text = c.Value Then
Label1 = c.Offset(, -1).Value
End If
Next c
End Sub
Private Sub CommandButton1_Click()
Dim ssheet As Worksheet
Set ssheet = ThisWorkbook.Sheets("database")
nr = ssheet.Cells(Rows.Count, 1).End(xlUp).Row + 1
ssheet.Cells(nr, 2) = Me.TextBox1
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Cell As Range
Application.EnableEvents = False
For Each Cell In Target
If Cell.Column = 2 Then
Cell.Offset(, 5).Value = Now
End If
If Cell.Column = 2 Then
Cell.Offset(, -1).Value = "CHM " & ((Year(Now) + 543 - 2500) * 10000) + (Range("A" & Rows.Count).End(xlUp).Row)
End If
Next Cell
Application.EnableEvents = True
End Sub
Private Sub CommandButton1_Click()
Dim c As Range
For Each c In Sheet3.Range("b2:b100").Cells
If TextBox1.Text = c.Value Then
Label1 = c.Offset(, -1).Value
End If
Next c
End Sub
Private Sub CommandButton1_Click()
Dim c As Range
For Each c In Sheet3.Range("b2:b100").Cells
If TextBox1.Text = c.Value Then
Label1 = c.Offset(, -1).Value
End If
Next c
End Sub