Hoppa till huvudinnehåll

Hur hoppar jag snabbt till cellen med nuvarande datum i Excel?

Här är ett ark med en lista med datum, du vill snabbt hoppa till cellen som är med aktuellt datum, hur löser man detta problem?

Hoppa till det aktuella datumet med VBA

Hoppa till aktuellt datum med Sök och ersätt


pil blå höger bubbla Hoppa till det aktuella datumet med VBA

Här är en VBA-kod som kan hjälpa dig att snabbt hoppa till cellen med aktuellt datum.

1. Aktivera arbetsboken du vill använda och tryck på Alt + F11 nycklar för att öppna Microsoft Visual Basic för applikationer fönster.

2. klick Insert > Modulerna, klistra in under koden i Modulerna.

VBA: Hoppa till aktuellt datum

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 hoppa till aktuellt datum 1

3. Tryck F5 -tangenten, sedan hoppar markören till cellen med aktuellt datum var du än befinner dig i arbetsboken.
doc hoppa till aktuellt datum 2


pil blå höger bubbla Hoppa till aktuellt datum med Sök och ersätt

Om du inte känner till VBA-koden kan du också använda Sök och ersätt verktyg för att hoppa till aktuellt datum.

1. Aktivera arket som innehåller datumlistan och välj en tom cell, skriv denna formel = I DAG (), Tryck ange nyckel, nu får du dagens datum.
doc hoppa till aktuellt datum 3

2. Tryck Ctrl + C för att kopiera dagens datum och välj datumlistan och tryck sedan på Ctrl + F för att aktivera Sök och ersätt i dialogrutan Hitta det textruta, tryck på Ctrl + V att klistra in dagens datum i. Se skärmdump:
doc hoppa till aktuellt datum 4

3. klick Hitta alla. Nu hoppar markören till cellen med idag i vald lista.
doc hoppa till aktuellt datum 5

Dricks: Om du har Kutools för Excelkan du tillämpa dess Välj specifika celler för att snabbt hantera denna uppgift. Det är full funktion utan begränsning på 30 dagar, vänligen ladda ner och få en gratis provperiod nu.
doc hoppa till aktuellt datum 6

Bästa kontorsproduktivitetsverktyg

🤖 Kutools AI Aide: Revolutionera dataanalys baserat på: Intelligent utförande   |  Generera kod  |  Skapa anpassade formler  |  Analysera data och generera diagram  |  Anropa Kutools funktioner.
Populära funktioner: Hitta, markera eller identifiera dubbletter   |  Ta bort tomma rader   |  Kombinera kolumner eller celler utan att förlora data   |   Rund utan formel ...
Superuppslag: Flera kriterier VLookup    VLookup med flera värden  |   VSök över flera ark   |   Fuzzy Lookup ....
Avancerad rullgardinslista: Skapa snabbt en rullgardinslista   |  Beroende rullgardinslista   |  Flervals-rullgardinslista ....
Kolumnhanterare: Lägg till ett specifikt antal kolumner  |  Flytta kolumner  |  Växla synlighetsstatus för dolda kolumner  |  Jämför intervall och kolumner ...
Utvalda funktioner: Rutnätsfokus   |  Designvy   |   Stor formelbar    Arbetsbok & Bladhanterare   |  Resursbibliotek (Automatisk text)   |  Datumväljare   |  Kombinera arbetsblad   |  Kryptera/Dekryptera celler    Skicka e-postmeddelanden efter lista   |  Superfilter   |   Specialfilter (filtrera fet/kursiv/genomstruken...) ...
Topp 15 verktygssatser12 text verktyg (lägga till text, Ta bort tecken, ...)   |   50+ Diagram Typer (Gantt Chart, ...)   |   40+ Praktiskt Formler (Beräkna ålder baserat på födelsedag, ...)   |   19 Införande verktyg (Infoga QR-kod, Infoga bild från sökväg, ...)   |   12 Konvertering verktyg (Siffror till ord, Valutaväxling, ...)   |   7 Slå ihop och dela verktyg (Avancerade kombinera rader, Dela celler, ...)   |   ... och mer

Uppgradera dina Excel-färdigheter med Kutools för Excel och upplev effektivitet som aldrig förr. Kutools för Excel erbjuder över 300 avancerade funktioner för att öka produktiviteten och spara tid.  Klicka här för att få den funktion du behöver mest...

Beskrivning


Fliken Office ger ett flikgränssnitt till Office och gör ditt arbete mycket enklare

  • Aktivera flikredigering och läsning i Word, Excel, PowerPoint, Publisher, Access, Visio och Project.
  • Öppna och skapa flera dokument i nya flikar i samma fönster, snarare än i nya fönster.
  • Ökar din produktivitet med 50 % och minskar hundratals musklick för dig varje dag!
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