VBA Excel Code Insert and Column - learnit

Home Top Ad

Post Top Ad

Wednesday, May 5, 2021

VBA Excel Code Insert and Column

VBA Excel Code Insert and Column

VBA Excel Code Insert and Column

What is Excel VBA?

VBA stands for Visual Basic for Applications. Excel VBA is Microsoft is programming language for Excel and all the other Microsoft Office programs, like Word and PowerPoint. The Office suite programs all share a common programming language.


The first method is to use the Macro Recorder. After activating the recorder, Excel will record all the steps a user makes and save it as a “process” known as a macro. When the user ends the recorder, this macro is saved and can be assigned to a button that will run the exact same process again when clicked. This method is relatively simple and requires no inherent knowledge of the VBA code. This method will work for simple processes.


Use the Rows property or the Columns property to work with entire rows or columns. These properties return a Range object that represents a range of cells. In the following example, Range(“B5”) returns row one on Sheet1. The Insert property of the EntireCoulmn.Insert object for the range is then set to True .


Example

Sub InsertColumn() Range(“C:C”).Insert Range(“1:1”).Insert Range(“B5”).EntireColumn.Insert Range(“A5”).EntireRow.Insert End Sub

Note:

Range(“C:C”).Insert used Insert Shift Cells right

Range(“1:1”).Insert Used Insert Shift Cells Down

Range(“B5”).EntireColumn.Insert Used Insert EntireColumn

Range(“A5”).EntireRow.Insert Used Insert EntireRow


Please Watching My Video is Below

No comments:

Post a Comment

Post Top Ad