Excel VBA - Rows and Columns Delete

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this video we'll see how to delete rows and columns into your excel sheet with help of macros so let us see now I will return some data here that's a previous video recorded data if you see here now the sheet name is our insert rows and columns at the sheet name the file name is Excel VBA and this data is written from the previous video video itself now if you want to delete some column how do we do it we usually right-click on this column heading and then we get the option for this option as delete same way if you want to delete the row you right-click on this row itself and you see the option given as delete so these are the methods which you use by deleting it in the excel sheet if you want to delete with the help of the macros how do you do that it's very simple okay so I'll just open the macro part first that's a VBA editor okay this is the VBA editor and I've written some code here but these are the names of the sheet and minimize the names of the sheet so I'll just click on this minimize button okay these are all the models which are present okay so in this place if you see the model name is delete rows and columns that's a model and that's a sub procedure which is written all the commands are written in this sub procedure so let me explain the first thing range of C 5 dot entire row delete range of C 5 if you see the range is C 5 C and that's a 5 number okay below the Tuesday if you see that is C 5 you want to delete the entire roof which is in the C 5 so related to this fifth row enter will be deleted self if you want to delete more than one row what you can do is you can select range a1 to a3 that means from here a1 to a3 that means the starting three rows will be deleted entire row dot delete ok so if you have you have to focus on this one : 3 if you see here 1 : 3 which is given the first row - third row in Tarot will be deleted similarly if you want to delete the columns you write as range cell number dot entire column dot delete or you can write a 1 - C 1 that's 3 columns so ABC if you observe here ABC entire roadway entire column would be deleted now what we'll do is I'll execute step by step and you can see what is happening here if I click on this cell if I click on the step into step into now C 5 if you observe here row number 5 will be deleted entirely if I click on the step into row number 5 is deleted entirely okay if you see a one two a three that means starting three rows would be deleted entirely so starting three rows 1 2 3 that means month and Jan should also be deleted if I click on just step into now if you observe here month and Jan has been deleted same way this was for the rows if I want to delete the columns range see v dot entire column delete so here if you see the column number C would be deleted here that's a C column it will be shifted to the left itself I'll click on this step in to now if you observe that has been shifted on the left hand side now if you want to delete more than one column what you can do is you can write this a one to see one okay that means starting three columns a B and C till here everything would be deleted so I'll just click on step into and if you observe three columns have been completely deleted and then come out of this sub procedure itself right so I hope able to understand how to delete your rows and columns via the help of VBA macros that's all for this video
Info
Channel: Tutorialspoint
Views: 135,506
Rating: undefined out of 5
Keywords: VBA, Marcos, Microsoft, Excel VBA, Excel VBA - Rows and Columns Delete, Rows and Columns Delete, Delete Rows, Delete Columns
Id: ykXfSmEr2OA
Channel Id: undefined
Length: 3min 10sec (190 seconds)
Published: Mon Jan 15 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.