สวัสดีครับ
ผมทำตารางเพื่อเก็บข้อมูล Serial ยางครับ แต่ติดปัญหาที่
Sheet Report ไม่สามารถค้นหาข้อมูลตามช่วงวันที่ที่ต้องการได้ครับ โดยมี
รายละเอียดดังนี้ครับ
ที่ Sheet Report ต้องการให้ช่อง I3 และ J3 ระบุวันที่เริ่มต้นและวันที่สิ้นสุด
และให้ Excel คำนวนหาข้อมูลในช่วงเวลาที่ต้องการครับ
ตอนนี้ทุกช่องทำงานได้หมด ( C3:H3 ) ยกเว้นช่องวันที่ไม่สามารถทำงานได้ครับ
ตามตัวอย่าง ระบุวันที่ 18-25 เดือนมกราคม แต่ข้อมูลออกมาทั้งหมดครับ
หมายเหตุ : เมื่อเลื่อกข้อมูลที่ต้องการและกดปุ่ม Enter
Excel จะค้นหาข้อมูลให้หลังจาก Enter ครับ
ใน Sheet Report ผมได้กำหนดรหัส VBA ไว้ดังนี้ครับ
Code: Select all
Option Explicit
Dim Rangselect As String
Private Sub ComboBox1_Change()
Call ViewReport
End Sub
'ทำงานทันทีเมื่อคลิกปุ่ม ENTER ( Sheet Report )
Private Sub Worksheet_Change(ByVal Target As Range)
'ActiveSheet.Unprotect "xxx"
If Target.Address = "$C$3" Or Target.Address = "$D$3" Or Target.Address = "$E$3" Or Target.Address = "$F$3" Or Target.Address = "$G$3" Or Target.Address = "$H$3" Or Target.Address = "$I$3" Or Target.Address = "$J$3" Then
Call ViewReport
'ActiveSheet.Protect "xxx"
End If
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
ActiveSheet.Shapes("AutoShape 1").Top = ActiveCell.Top
End Sub
ขอบคุณครับ
You do not have the required permissions to view the files attached to this post.