Friday, 31 August 2012

Macro To Insert Desired No.Of Rows And Columns In A Active Sheet


Macro To Insert Desired No.Of Rows And Columns In A  Active  Sheet


Sub InsertRows()
Dim i, j

i = InputBox("Enter The No.of Rows Required ")
Range(ActiveCell.Offset(0, 0), ActiveCell.Offset(i - 1, 0)).Select
Selection.EntireRow.Insert

j = InputBox("Enter The No.of Columns Required ")
Range(ActiveCell.Offset(0, 0), ActiveCell.Offset(0, j - 1)).Select
Selection.EntireColumn.Insert

End Sub

No comments:

Post a Comment

Follow Me by Email

ExcelKingdom-Popular Posts

ExcelKingdom-Random Posts