ไปยังเนื้อหาหลัก

จะข้ามไปยังเซลล์อย่างรวดเร็วด้วยวันที่ปัจจุบันใน Excel ได้อย่างไร?

นี่คือแผ่นงานที่มีรายการวันที่คุณต้องการข้ามไปยังเซลล์ที่มีวันที่ปัจจุบันอย่างรวดเร็ววิธีแก้ปัญหานี้

ข้ามไปยังวันที่ปัจจุบันด้วย VBA

ข้ามไปยังวันที่ปัจจุบันด้วยค้นหาและแทนที่


ลูกศรสีฟ้าฟองขวา ข้ามไปยังวันที่ปัจจุบันด้วย VBA

นี่คือรหัส VBA ที่สามารถช่วยให้คุณข้ามไปยังเซลล์ด้วยวันที่ปัจจุบันได้อย่างรวดเร็ว

1. เปิดใช้งานสมุดงานที่คุณต้องการใช้แล้วกด Alt + F11 คีย์เพื่อเปิด Microsoft Visual Basic สำหรับแอปพลิเคชัน หน้าต่าง

2 คลิก สิ่งที่ใส่เข้าไป > โมดูลวางโค้ดด้านล่างลงในไฟล์ โมดูล.

VBA: ข้ามไปที่วันที่ปัจจุบัน

Private Sub Workbook_Open()
'UpdatebyExtendoffice20161221
    Dim daterng As Range
    Dim DateCell As Range
    Dim WorkSht As Worksheet
    Dim dateStr As String
    Application.ScreenUpdating = False
    For Each WorkSht In Worksheets
        WorkSht.Select
        'Set daterng = Range("A:A")
        Set daterng = WorkSht.UsedRange
        'daterng.Select
        For Each DateCell In daterng
            DateCell.Activate
            ActiveCell.Select
            On Error Resume Next
            dateStr = DateCell.Value
            If dateStr = Date Then
                DateCell.Select
                Exit Sub
            End If
        Next
    Next WorkSht
    Application.ScreenUpdating = True
    'Worksheets(1).Select
End Sub

doc ข้ามไปที่วันที่ปัจจุบัน 1

3 กด F5 จากนั้นเคอร์เซอร์จะข้ามไปยังเซลล์พร้อมวันที่ปัจจุบันทุกที่ที่คุณค้นหาในสมุดงาน
doc ข้ามไปที่วันที่ปัจจุบัน 2


ลูกศรสีฟ้าฟองขวา ข้ามไปยังวันที่ปัจจุบันด้วยค้นหาและแทนที่

หากคุณไม่คุ้นเคยกับรหัส VBA คุณสามารถใช้ไฟล์ ค้นหาและแทนที่ ยูทิลิตี้เพื่อข้ามไปยังวันที่ปัจจุบัน

1. เปิดใช้งานแผ่นงานที่มีรายการวันที่และเลือกเซลล์ว่างพิมพ์สูตรนี้ = วันนี้ ()กด เข้าสู่ ที่สำคัญตอนนี้คุณได้รับวันที่ในวันนี้
doc ข้ามไปที่วันที่ปัจจุบัน 3

2 กด Ctrl + C เพื่อคัดลอกวันที่ของวันนี้และไปที่เลือกรายการวันที่จากนั้นกด Ctrl + F เพื่อเปิดใช้งาน ค้นหาและแทนที่ กล่องโต้ตอบในไฟล์ สิ่งที่ค้นหา กล่องข้อความกด Ctrl + V เพื่อวางวันที่ของวันนี้ลงใน ดูภาพหน้าจอ:
doc ข้ามไปที่วันที่ปัจจุบัน 4

3 คลิก ค้นหาทั้งหมด. ตอนนี้เคอร์เซอร์จะข้ามไปที่เซลล์โดยมีวันนี้ในรายการที่เลือก
doc ข้ามไปที่วันที่ปัจจุบัน 5

เคล็ดลับ: ถ้าคุณมี Kutools สำหรับ Excelคุณสามารถใช้ไฟล์ เลือกเซลล์เฉพาะ เพื่อจัดการงานนี้ได้อย่างรวดเร็ว ใช้งานได้เต็มประสิทธิภาพไร้ขีดจำกัดใน 30 วัน โปรดดาวน์โหลดและทดลองใช้ฟรีทันที
doc ข้ามไปที่วันที่ปัจจุบัน 6

สุดยอดเครื่องมือเพิ่มผลผลิตในสำนักงาน

🤖 Kutools AI ผู้ช่วย: ปฏิวัติการวิเคราะห์ข้อมูลโดยยึดตาม: การดำเนินการที่ชาญฉลาด   |  สร้างรหัส  |  สร้างสูตรที่กำหนดเอง  |  วิเคราะห์ข้อมูลและสร้างแผนภูมิ  |  เรียกใช้ฟังก์ชัน Kutools...
คุณสมบัติยอดนิยม: ค้นหา เน้น หรือระบุรายการที่ซ้ำกัน   |  ลบแถวว่าง   |  รวมคอลัมน์หรือเซลล์โดยไม่สูญเสียข้อมูล   |   รอบโดยไม่มีสูตร ...
การค้นหาขั้นสูง: VLookup หลายเกณฑ์    VLookup หลายค่า  |   VLookup ข้ามหลายแผ่น   |   การค้นหาที่ไม่ชัดเจน ....
รายการแบบเลื่อนลงขั้นสูง: สร้างรายการแบบหล่นลงอย่างรวดเร็ว   |  รายการแบบหล่นลงขึ้นอยู่กับ   |  เลือกหลายรายการแบบหล่นลง ....
ผู้จัดการคอลัมน์: เพิ่มจำนวนคอลัมน์เฉพาะ  |  ย้ายคอลัมน์  |  สลับสถานะการมองเห็นของคอลัมน์ที่ซ่อนอยู่  |  เปรียบเทียบช่วงและคอลัมน์ ...
คุณสมบัติเด่น: กริดโฟกัส   |  มุมมองการออกแบบ   |   บาร์สูตรใหญ่    สมุดงานและตัวจัดการชีต   |  ห้องสมุดทรัพยากร (ข้อความอัตโนมัติ)   |  เลือกวันที่   |  รวมแผ่นงาน   |  เข้ารหัส/ถอดรหัสเซลล์    ส่งอีเมลตามรายการ   |  ซุปเปอร์ฟิลเตอร์   |   ตัวกรองพิเศษ (กรองตัวหนา/ตัวเอียง/ขีดทับ...) ...
ชุดเครื่องมือ 15 อันดับแรก12 ข้อความ เครื่องมือ (เพิ่มข้อความ, ลบอักขระ, ... )   |   50 + แผนภูมิ ประเภท (แผนภูมิ Gantt, ... )   |   40+ ใช้งานได้จริง สูตร (คำนวณอายุตามวันเกิด, ... )   |   19 การแทรก เครื่องมือ (ใส่ QR Code, แทรกรูปภาพจากเส้นทาง, ... )   |   12 การแปลง เครื่องมือ (ตัวเลขเป็นคำ, การแปลงสกุลเงิน, ... )   |   7 ผสานและแยก เครื่องมือ (แถวรวมขั้นสูง, แยกเซลล์, ... )   |   ... และอื่น ๆ

เพิ่มพูนทักษะ Excel ของคุณด้วย Kutools สำหรับ Excel และสัมผัสประสิทธิภาพอย่างที่ไม่เคยมีมาก่อน Kutools สำหรับ Excel เสนอคุณสมบัติขั้นสูงมากกว่า 300 รายการเพื่อเพิ่มประสิทธิภาพและประหยัดเวลา  คลิกที่นี่เพื่อรับคุณสมบัติที่คุณต้องการมากที่สุด...

รายละเอียด


แท็บ Office นำอินเทอร์เฟซแบบแท็บมาที่ Office และทำให้งานของคุณง่ายขึ้นมาก

  • เปิดใช้งานการแก้ไขและอ่านแบบแท็บใน Word, Excel, PowerPoint, ผู้จัดพิมพ์, Access, Visio และโครงการ
  • เปิดและสร้างเอกสารหลายรายการในแท็บใหม่ของหน้าต่างเดียวกันแทนที่จะเป็นในหน้าต่างใหม่
  • เพิ่มประสิทธิภาพการทำงานของคุณ 50% และลดการคลิกเมาส์หลายร้อยครั้งให้คุณทุกวัน!
Comments (4)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
This example is horribly slow. You could probably trim some of the find parameters, so test if you want.
Code:

'Find todays date in the sheet and activate cell
Cells.Find(What:=Date, After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False).Activate
'-----

ActiveWindow.ScrollRow = ActiveCell.Row 'scroll view to selected cell
This comment was minimized by the moderator on the site
I am a novice with Microsoft Office, and Excel, but I am a programmer by nature. If the objective is to locate a cell with today's date - and position the cursor to it, I can't see the need for all that code.A simple code (listed below) created in a macro, and assign the macro to a letter say "T", and as an option you may even created a button and assign the macro to it, so when you click the button you will travel directly to that cell.The comments lines (those that start with ') are optional. You may choose not to type them. I used them for troubleshooting the code. "Msgbox" is a nice tool to communicate with you.Here is my code:---------------------------------Sub GoToToday()
'
' GoToToday Macro
'
' Keyboard Shortcut: Ctrl+t
'
Dim DateRange, DateCell As Range
Dim i As Byte
Dim x As String
On Error Resume Next

MySheet = ActiveSheet.Name

' MsgBox (Date)
For i = 12 To 130
x = "A" & i
' MsgBox (x)
' MsgBox (Worksheets(MySheet).Range(x))

If Worksheets(MySheet).Range(x).Value = Date Then
' MsgBox (i)
' MsgBox (x)
' MsgBox (Worksheets(MySheet).Range(x))
x = "D" & i
Range(x).Select
Exit Sub
End If
Next:
End Sub

This comment was minimized by the moderator on the site
Same results as Peter ... F5 brings up GoTo. We also tried Ctrl-F5 and Alt-F5. Is there some other key sequence or addition to the code? Thanks.
This comment was minimized by the moderator on the site
This doesn't work with the VBA code, it just brings up a window called "Go To". Were we meant to edit the VBA code in some way?
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations