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

 Πώς να συμπληρώσετε αυτόματα τον τύπο κατά την εισαγωγή γραμμών στο Excel;

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

τύπος αυτόματης συμπλήρωσης doc που εισάγει τη σειρά 1

Αυτόματη συμπλήρωση φόρμουλας κατά την εισαγωγή κενών γραμμών με τη δημιουργία πίνακα

Τύπος αυτόματης συμπλήρωσης κατά την εισαγωγή κενών σειρών με κώδικα VBA


Αυτόματη συμπλήρωση φόρμουλας κατά την εισαγωγή κενών γραμμών με τη δημιουργία πίνακα

Στο Excel, η μορφή πίνακα μπορεί να σας βοηθήσει να συμπληρώσετε αυτόματα τον παραπάνω τύπο στις νέες κενές κενές γραμμές, κάντε τα εξής:

1. Επιλέξτε το εύρος δεδομένων που θέλετε να συμπληρώσετε αυτόματα τον τύπο και, στη συνέχεια, κάντε κλικ στο Κύριο θέμα > Τραπέζι, δείτε το στιγμιότυπο οθόνης:

τύπος αυτόματης συμπλήρωσης doc που εισάγει τη σειρά 2

2. Στην Δημιουργία πίνακα διαλόγου, ελέγξτε το Ο πίνακας μου έχει κεφαλίδες εάν υπάρχουν κεφαλίδες στα δεδομένα σας, δείτε το στιγμιότυπο οθόνης:

τύπος αυτόματης συμπλήρωσης doc που εισάγει τη σειρά 3

3. Στη συνέχεια κάντε κλικ στο κουμπί OK κουμπί και ο πίνακας έχει δημιουργηθεί και τώρα, όταν εισάγετε μια κενή σειρά, ο παραπάνω τύπος θα εισαχθεί αυτόματα στη νέα σειρά, δείτε το στιγμιότυπο οθόνης:

τύπος αυτόματης συμπλήρωσης doc που εισάγει τη σειρά 4


Τύπος αυτόματης συμπλήρωσης κατά την εισαγωγή κενών σειρών με κώδικα VBA

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

1. Επιλέξτε την καρτέλα φύλλου εργασίας που περιέχει τους τύπους που θέλετε να συμπληρώσετε αυτόματα και κάντε δεξί κλικ για να επιλέξετε Προβολή κωδικού από το μενού περιβάλλοντος για να μεταβείτε στο Microsoft Visual Basic για εφαρμογές παράθυρο και, στη συνέχεια, αντιγράψτε και επικολλήστε τον ακόλουθο κώδικα στη λειτουργική μονάδα:

Κωδικός VBA: Τύπος αυτόματης συμπλήρωσης κατά την εισαγωγή κενών γραμμών

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
'Updateby Extendoffice 20160725
    Cancel = True
    Target.Offset(1).EntireRow.Insert
    Target.EntireRow.Copy Target.Offset(1).EntireRow
    On Error Resume Next
    Target.Offset(1).EntireRow.SpecialCells(xlConstants).ClearContents
End Sub

τύπος αυτόματης συμπλήρωσης doc που εισάγει τη σειρά 5

2. Στη συνέχεια, αποθηκεύστε και κλείστε αυτόν τον κωδικό, επιστρέψτε στο φύλλο εργασίας, τώρα, όταν κάνετε διπλό κλικ σε ένα κελί μεταξύ των δεδομένων, θα εισαχθεί μια νέα σειρά κάτω από το ενεργό κελί και ο τύπος συμπληρώνεται αυτόματα.


Επίδειξη: Τύπος αυτόματης συμπλήρωσης κατά την εισαγωγή κενών γραμμών

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

🤖 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
This works GREAT, until I protect the worksheet (to protect my forumulas in other cells). Can you let me know what i need to do to keep this functionality once the worksheet is protected?
This comment was minimized by the moderator on the site
Excellent simple piece of code!!!!
This comment was minimized by the moderator on the site
Hi,

This code is very helpful, however, I have a slightly different requirement. The formulas should be copied when the row is inserted manually, i.e. by "insert row".
Can you please resend the code after incorporating this change i.e. instead of "Worksheet_BeforeDoubleClick", some other trigger point to be used "insert row/etc"

Note - I do have any exposure to coding being from the Accounts background.


Regards
Niket Shet
This comment was minimized by the moderator on the site
Hi Niket. You can see all the options for different trigger points in the tab itself.

For this click on CTRL + F11 to open the code editor as explained in the video above, and there will be 2 dropdowns on the top of the code which you would copy, click on the second dropdown and you can find many options for different trigger points.

The first dropdown would be ideally set to "Worksheet" and the second one would be set to "BeforeDoubleClick". You can change the second trigger point to your liking and use accordingly.

Hope it helps!
This comment was minimized by the moderator on the site
I had the same question as Niket, so I tried looking at the list of trigger points in the second dropdown and I don't see anything that clearly works as Niket or I intend with the (select row+right click+insert row functionality). I tried the "BeforeRightClick" option but it just inserts a row w/formulas anytime I right click a cell, which is definitely not what I was looking for. Is there a resource somewhere that explains what each of the triggers can be used for? Or is there possibly another way to get to this functionality?

Thanks!
Jeff
This comment was minimized by the moderator on the site
I am using the code to insert a line on double-click. However, there is something wrong, Excel does not increment the first reference in my formula in the next but one row. However, it is corrected for all remaining rows.
I inserted a line at row 144 and this is what I got: (note S144 in 3rd line should be S145)
row 144 =(S143+D144+E144)-(K144+L144+M144+N144+O144+Q144+R144)
row 145 =(S144+D145+E145)-(K145+L145+M145+N145+O145+Q145+R145)
row 146 =(S144+D146+E146)-(K146+L146+M146+N146+O146+Q146+R146)
row 147 =(S146+D147+E147)-(K147+L147+M147+N147+O147+Q147+R147)
Any clues as to why it does this, I don't think it is the VBA???
David
This comment was minimized by the moderator on the site
Does the table method work in excel for xp (2002) and if yes, how?
This comment was minimized by the moderator on the site
The code works very well, but does not update cell reference in first row after the inserted row.See below" e.g 50 10 40 40 10 50 40 20 20
This comment was minimized by the moderator on the site
This code is very good, but it does not update the cell reference in the first following row after the inserted row. Can you please help? e.g: 50 10 40 40 10 50 40 20 20
This comment was minimized by the moderator on the site
Above formula is very helpful for me please tell me how to use this code permanently
This comment was minimized by the moderator on the site
dear above formula which helps to update the above formula on inserting row by double clicking. I want to know how to use this code permanently because when i close the sheet and reopen code finishes. Please help to solve the issue. This formula is very helpful for me
This comment was minimized by the moderator on the site
Hi Bilal. You need to save the file as a "Macro Enabled" file to get the code to work once you close and reopen the file. To save the file as Macro, just use "Save as" and then select "Excel-Macro Enabled Workbook" to get the desired result.
This comment was minimized by the moderator on the site
Very easy solution. Thank you very much.
This comment was minimized by the moderator on the site
I followed the VBA code mentioned above for my xls. I have one .xls with multiple sheets in it , i want if i insert a row in my one sheet at the start or any of the sheet for that matter it should auto insert row in all my sheet in the same worksheet. Also each of my sheet as formulas hence i want the moment auto insert takes place the formula of above row should get autofill in the new row which is not happening totally if i follow the VBA code mentioned , the rows are getting inserted in all my sheets the formula also shows up but it misses one row in it. Eg. I have sheet A with 100 rows , sheet B with 100 ros and so on with other sheets. If I insert row in sheet A it shows auto insert in Sheet B , but sheet B values of some column are linked with sheet A and the moment i insert a row eg 10 , row 11 is a new row and the same row 11 in sheet B also shows up but the value it should pull from row 11 of sheet A from column C rather it shows row 12 of sheet A , this happens on any row i insert the value in sheet B is always of the next row rather than same row that i inserted. Another problem that comes here is with my first column Sr. no the moment i insert a row in 5 , sr no 6 with new row shows up but prior to that i already had row 6 as i have a formula for Sr. no A6+1 as my column starts from A6 and so on so how to sort this issue with 2 rows with same sr. no. This is very crucial sheet am working on and i need to get this sorted, i have refereed many VBA codes but none is effective. Hoping for a proper solution to my issue.
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations