How To Insert Rows Using VBA In Excel || Excel Tutorials || VBA tricks

dptutorials
dptutorials
14.9 هزار بار بازدید - 3 سال پیش - In this tutorial, let us
In this tutorial, let us learn how to insert rows using VBA in Excel.
First let me show you how to insert a single row using the vba code.

DON'T CLICK THIS: ➡️ https://bit.ly/3sPIZvD
Link to download the exercise file: ➡️ https://bit.ly/3gFXKfk

Best Laptops to use for better speed:
1️⃣ https://amzn.to/3lf8zYU
2️⃣ https://amzn.to/3xejpAW
3️⃣ https://amzn.to/379OqeL

Best Equipment & Tools for YouTube Channel : ➡️ https://bit.ly/3inKa1P

Go to the vba editor window, type the code as

Sub vba_add_row()
Range("A1").EntireRow.Insert
End Sub
Now, if you run this macro, it will add a row before the cell that we mention in the code.

Go to excel and run the macro to see a new row getting inserted in the first row.

Similarly, if you want to insert multiple rows, mention the range in the vba code like this.
Sub vba_add_row()
Range("A1:A3").EntireRow.Insert
End Sub
Run this macro to see that 3 new rows getting added on top.

Now, let us see the main useful vba code to enable the user to add the desired number of rows at required location.
I am going to the vba editor window and typing the code like this.

Sub vba_add_row()
Dim iRow As Long
Dim iCount As Long
Dim i As Long

iCount = InputBox(Prompt:="How many rows you want to insert?")
iRow = InputBox _
(Prompt:="Before which row you want to insert rows? (Enter the row number)")
For i = 1 To iCount
   Rows(iRow).EntireRow.Insert
   Next i
End Sub

Let us run the code now, it will ask you to enter the number of rows that you want to add, say 4 and click on ok.

Our Recommendations
***************************************************************
Oracle Primavera Tutorials : https://bit.ly/3fn9PFH
Microsoft Excel Tutorials : https://bit.ly/2V5de5l
Microsoft Project Tutorials : https://bit.ly/37guNl7

For Personalized detail learning, write to [email protected]

If you found this video valuable, give it a like. If you know someone who needs to see it, share it. Leave a comment below with your thoughts. Add it to a playlist if you want to watch it later.

***********************************************
★ My Online Tutorials ► https://www.dptutorials.com

⚡️LEARNING RESOURCES I Recommend: https://www.dptutorials.com/resources

⚡️Subscribe for more Awesome Tutorials: http://goo.gl/NyAtg2

⚡️Support the Channel via shopping: https://amzn.to/2ZRfTOZ   http://ift.tt/2jH38PR  

⚡️Tools for YouTube vlogging:
***********************************************
•  Laptop:  https://amzn.to/2UqFu1K
•  Canon 200D Camera: https://amzn.to/3gcfbUT
•  Benro Tripod:  https://amzn.to/3D0fQ5l
•  Microphone:  https://amzn.to/2XDiOg7
•  Collar Microphone: https://amzn.to/3miLB3X
•  Screen recorder:  https://techsmith.pxf.io/2BMjA  
•  Boom Arm Stand:  https://amzn.to/3gaVDQs
•  Zoom H1 Audio Recorder:  https://amzn.to/3AMpkzg
•  Harison Softbox Studio Lights:  https://amzn.to/2W7ZuXi
•  Chroma Key Green Screen:  https://amzn.to/3gdjCP9
•  Background Support Stand:  https://amzn.to/3m9Ej2l
•  Acoustic Foam Background:  https://amzn.to/3xYv07E
•  USB RGB LED Strip:  https://amzn.to/3g9k4xO
•  Wireless Mouse:  https://amzn.to/2XxqMqV
***********************************************

⚡️You Can Connect with Me at:
***********************************************
YouTube: dptutorials
Instagram: Instagram: dptutorials
G+: http://ift.tt/2kAOpa6
Twitter: Twitter: dptutorials15
Facebook: http://ift.tt/2kfRnDi
BlogSpot: http://ift.tt/2kB14dh
Websites: http://www.dptutorials.com & http://www.askplanner.blogspot.com
Telegram: https://t.me/dptutorials16

#dptutorials  #Exceltraining #ExcelTricks #ExcelTips #ExcelFreeTraining #ExcelFreeLearning

⚡️Tags: -
excel formulas in English, excel in English, excel tutorial in English,ms excel in english,ms excel tutorial in English, learn excel in English,vlookup in excel in English, learn ms excel in English, excel training, excel tutorial, Microsoft Excel 2007, learn excel,tutorial excel, ms excel tutorial, excel tutorials,ms excel 2007,Microsoft Excel training,learn excel online,learning excel,free excel training,online excel training,advanced excel tutorial,excel tutorial, excel formulas and functions, excel formulas, excel tutorial in Hindi, excel formulas and functions in Hindi, excel tricks, excel in Hindi, excel shortcut keys, excel vlookup, excel formulas in Hindi, excel for beginners, excel for accounting, excel formulas and functions tutorial, Excel Sum Formula, Sum Formula series, excel attendance sheet, excel salary sheet, excel stock maintain, excel data entry, advanced excel tutorial,excel formulas,excel tutorial,vlookup excel,excel accounting,excel for beginners

⚡️Note: This description contains affiliate links, which means at no additional cost to you, we will receive a small commission if you make a purchase using the links. This helps support the channel and allows us to continue to make videos like this. Thank you for your support!
3 سال پیش در تاریخ 1400/02/31 منتشر شده است.
14,948 بـار بازدید شده
... بیشتر