Μετάβαση στο κύριο περιεχόμενο

Πώς να ορίσετε τη σειρά καρτελών κελιών ή ξεκλειδωμένων κελιών στο Excel;

Ας υποθέσουμε ότι πρέπει να ορίσετε τη σειρά καρτελών για τα δικά σας καθορισμένα κελιά, για παράδειγμα, πατήστε το πλήκτρο Tab θα μετακινηθεί από το κελί B5 στο C6, από το C6 στο D7, από το D7 στο E8, και στη συνέχεια επιστρέψτε στο B5 όταν αφήνετε το κελί E8 σε ένα φύλλο εργασίας όπως φαίνεται παρακάτω στιγμιότυπο οθόνης. Πώς να το πετύχετε; Αυτό το άρθρο παρέχει μια μέθοδο VBA για εσάς.

Ορίστε τη σειρά καρτελών κελιών ή ξεκλειδωμένων κελιών με κώδικα VBA


Ορίστε τη σειρά καρτελών κελιών ή ξεκλειδωμένων κελιών με κώδικα VBA

Εκτελέστε την παρακάτω μέθοδο VBA για να ορίσετε τη σειρά καρτελών κελιών σε κανονικό φύλλο εργασίας ή ξεκλειδωμένα κελιά σε προστατευμένο φύλλο εργασίας.

1. Στο φύλλο εργασίας πρέπει να ορίσετε τη σειρά καρτελών, κάντε δεξί κλικ στην καρτέλα φύλλων και κάντε κλικ στο Προβολή κωδικού από το μενού περιβάλλοντος.

2. Στο Microsoft Visual Basic για εφαρμογές παράθυρο, αντιγράψτε και επικολλήστε τον παρακάτω κώδικα VBA στο Κώδικας παράθυρο.

Κωδικός VBA: Ορισμός σειράς καρτελών καρτελών ή ξεκλειδωμένων κελιών

Private Sub Worksheet_Change(ByVal Target As Range)
    Dim tabArray As Variant
    Dim i As Long
    tabArray = Array("B5", "C6", "D7", "E8")
    Application.ScreenUpdating = False
    For i = LBound(tabArray) To UBound(tabArray)
        If tabArray(i) = Target.Address(0, 0) Then
            If i = UBound(tabArray) Then
                Me.Range(tabArray(LBound(tabArray))).Select
            Else
                Me.Range(tabArray(i + 1)).Select
            End If
        End If
    Next i
    Application.ScreenUpdating = True
End Sub

Notes:

1) Στον κωδικό, B5, C6, D7, E8 είναι η σειρά των κελιών εισαγωγής και πρέπει να χρησιμοποιήσετε το κεφαλαίο γράμμα της διεύθυνσης κελιού. Μπορείτε να τα αλλάξετε ανάλογα με τις ανάγκες σας.
2) Για το προστατευμένο φύλλο εργασίας, τα κελιά εισόδου πρέπει να ξεκλειδωθούν.

3. Πάτα το άλλος + Q πλήκτρα για να κλείσετε το Microsoft Visual Basic για εφαρμογές παράθυρο.

Από τώρα και στο εξής, μετά την εισαγωγή δεδομένων στο B5, ο δρομέας πηγαίνει στο C6 πατώντας το πλήκτρο Tab ή Enter, μετά πηγαίνει στο D7 κατά την έξοδο από το C6 και μετά μετακινείται στο D7, E8 στο τρέχον φύλλο εργασίας.


Σχετικά Άρθρα:

Τα καλύτερα εργαλεία παραγωγικότητας γραφείου

🤖 Kutools AI Aide: Επανάσταση στην ανάλυση δεδομένων με βάση: Ευφυής Εκτέλεση   |  Δημιουργία κώδικα  |  Δημιουργία προσαρμοσμένων τύπων  |  Αναλύστε δεδομένα και δημιουργήστε γραφήματα  |  Επίκληση Λειτουργιών Kutools...
Δημοφιλή χαρακτηριστικά: Εύρεση, επισήμανση ή αναγνώριση διπλότυπων   |  Διαγραφή κενών γραμμών   |  Συνδυάστε στήλες ή κελιά χωρίς απώλεια δεδομένων   |   Γύρος χωρίς φόρμουλα ...
Σούπερ Αναζήτηση: VLookup πολλαπλών κριτηρίων    VLookup πολλαπλών τιμών  |   VLookup σε πολλά φύλλα   |   Ασαφής αναζήτηση ....
Σύνθετη αναπτυσσόμενη λίστα: Γρήγορη δημιουργία αναπτυσσόμενης λίστας   |  Εξαρτημένη αναπτυσσόμενη λίστα   |  Πολλαπλή αναπτυσσόμενη λίστα ....
Διαχειριστής στήλης: Προσθέστε έναν συγκεκριμένο αριθμό στηλών  |  Μετακίνηση στηλών  |  Εναλλαγή κατάστασης ορατότητας κρυφών στηλών  |  Συγκρίνετε εύρη και στήλες ...
Επιλεγμένα Χαρακτηριστικά: Εστίαση πλέγματος   |  Προβολή σχεδίου   |   Μεγάλη Formula Bar    Διαχείριση βιβλίου εργασίας & φύλλου   |  Βιβλιοθήκη πόρων (Αυτόματο κείμενο)   |  Επιλογή ημερομηνίας   |  Συνδυάστε φύλλα εργασίας   |  Κρυπτογράφηση/Αποκρυπτογράφηση κελιών    Αποστολή email ανά λίστα   |  Σούπερ φίλτρο   |   Ειδικό φίλτρο (φίλτρο με έντονη γραφή/πλάγια γραφή/διαγραφή...) ...
Κορυφαία 15 σύνολα εργαλείων12 Κείμενο Εργαλεία (Προσθήκη κειμένου, Κατάργηση χαρακτήρων, ...)   |   50 + Διάγραμμα Τύποι (Gantt διάγραμμα, ...)   |   40+ Πρακτικό ΜΑΘΗΜΑΤΙΚΟΙ τυποι (Υπολογίστε την ηλικία με βάση τα γενέθλια, ...)   |   19 Εισαγωγή Εργαλεία (Εισαγωγή κωδικού QR, Εισαγωγή εικόνας από το μονοπάτι, ...)   |   12 Μετατροπή Εργαλεία (Αριθμοί σε λέξεις, Μετατροπή Συναλλάγματος, ...)   |   7 Συγχώνευση & διαχωρισμός Εργαλεία (Σύνθετες σειρές συνδυασμού, Διαίρεση κελιών, ...)   |   ... κι αλλα

Αυξήστε τις δεξιότητές σας στο Excel με τα Kutools για Excel και απολαύστε την αποτελεσματικότητα όπως ποτέ πριν. Το Kutools για Excel προσφέρει πάνω από 300 προηγμένες δυνατότητες για την ενίσχυση της παραγωγικότητας και την εξοικονόμηση χρόνου.  Κάντε κλικ εδώ για να αποκτήσετε τη δυνατότητα που χρειάζεστε περισσότερο...

Περιγραφή


Το Office Tab φέρνει τη διεπαφή με καρτέλες στο Office και κάνει την εργασία σας πολύ πιο εύκολη

  • Ενεργοποίηση επεξεργασίας και ανάγνωσης καρτελών σε Word, Excel, PowerPoint, Publisher, Access, Visio και Project.
  • Ανοίξτε και δημιουργήστε πολλά έγγραφα σε νέες καρτέλες του ίδιου παραθύρου και όχι σε νέα παράθυρα.
  • Αυξάνει την παραγωγικότητά σας κατά 50% και μειώνει εκατοντάδες κλικ του ποντικιού για εσάς κάθε μέρα!
Comments (14)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
I have copied your code into my worksheet, but as soon as I close it and reopen it to use it again, the code is gone. How do I save this?
This comment was minimized by the moderator on the site
Hi Anita,
If you want to keep the VBA code for feature use, after adding the VBA code, save your workbook as an Excel Macro-enabled workbook as shown in the screenshot below. Then use the newly saved file in the future.
https://www.extendoffice.com/images/stories/comments/comment-picture-zxm/Excel_macro-enabled_workbook.png
This comment was minimized by the moderator on the site
Olá, o código VBA para definir a ordem das células desejadas funcionou perfeitamente. Eu percebi que para que ele funcione, é necessário entrar com um dado na célula e pressionar TAB ou ENTER.
PERGUNTA: Você tem como fazer este código percorrer todas as células (no meu caso são 31, sendo algumas vazias e outras com valores padrão) sem ter que entrar com dados nelas, somente pressionando TAB ou ENTER. Como eu tenho algumas células vazias e outras com valores, por padrão, eu gostaria de percorrer as células sem precisar entrar com dados em todas elas novamente, mas, somente alterando as células que forem preciso alterar.att

Text translated by Google Translator
Hello, the VBA code to set the order of the desired cells worked perfectly. I realized that for it to work, it's necessary to enter data into the cell and press TAB or ENTER.
QUESTION: You can make this code go through all the cells (in my case there are 31, some being empty and others with default values) without having to enter data in them, just pressing TAB or ENTER. As I have some empty cells and others with values, by default I would like to cycle through the cells without having to enter data in all of them again, but only changing the cells that I need to change.att

This comment was minimized by the moderator on the site
Hello, New here The VBA code works until I hit a Pull Down Box, I get to the first on make my selection , hit Tab and it moves to a locked cell, It acts like a cell I did not enter any data in. Any suggestions? GlennD24
This comment was minimized by the moderator on the site
Hello, is there a way to just hit enter without entering anything and have it go to the next selection?
This comment was minimized by the moderator on the site
No me funcionó, lo coloqué en la hoja de trabajo, debe haber algún error, me podrían ayudar, necesito implementarlo en mi trabajo,

atte,

Collins Neptali Arráiz López
This comment was minimized by the moderator on the site
Thanks for the code on enter order. I am working on a spreadsheet entering barcode information and I need to span up to 300 cells and the program only lets me enter 142 cells. Is there a way to add more so I can get up to 300?



Thanks
This comment was minimized by the moderator on the site
Hi Jeanne,
Thanks for your comment.
But the code can’t be optimized to meet your needs. Sorry about that.
This comment was minimized by the moderator on the site
First select which cells you want to have unprotected.

When you protect your sheet it will automatically set the tab order according to your unprotected cells. It will Tab forward from Left to Right, and Top to Bottom; Shift+Tab backward from Right To Left, and Bottom to Top.
This comment was minimized by the moderator on the site
Dear Evan,
Thank you for sharing.
This comment was minimized by the moderator on the site
With the order that you have listed them excel does without VBA code. Make them go backwards then you got something.
This comment was minimized by the moderator on the site
Hello and thank you for the VBA code to set the tab order in a protected sheet where the form control labels and form control drop-down boxes are unlocked and the user can tab through and fill out the information in a label, and when tabbing to a drop down list select the number of items the instructions give him, and I have made progress with your code. At first I could only tab through each of the label form controls, now I sometimes hit the drop down lists. I would really enjoy a turorial on how tro do tis
This comment was minimized by the moderator on the site
Is it possible to use this same code to force tab across each row to each unprotected cell? I need to tab starting at cell A15, and then move to the next unprotected cell (C15), then E15, then G15. Once here, I need to tab to A16 and repeat the process for the remainder of the form. The reason I need this is that data is entered by barcode scanner, and some are programmed to tab, and others to enter. Thanks for your help on this. Spinaz
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations