Add blank rows based on the value in a cell.

Closed
Kritika Dixit Posts 1 Registration date Saturday February 1, 2014 Status Member Last seen February 1, 2014 - Feb 1, 2014 at 02:38 AM
mdazgt Posts 8 Registration date Monday July 14, 2014 Status Member Last seen July 19, 2014 - Jul 15, 2014 at 11:05 AM
Hello,

How to add blank rows based on the value in a cell.


Say if value in cell is 9, then 9 number of blank rows to be entered automatically.



Related:

3 responses

venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 811
Feb 1, 2014 at 06:54 AM
Suppose your data is like this (in A1,a2,a3)
1
2
3
Then right click TAB of the sheet and click view code.
In the window that comes up copy this code. Save the file


Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim j As Integer
If Target.Column <> 1 Then Exit Sub
If Target = "" Then Exit Sub

Application.EnableEvents = False
j = Target
Range(Target.Offset(1, 0), Target.Offset(j, 0)).EntireRow.Insert
Application.EnableEvents = True
MsgBox "done"


End Sub
Now select any one of A1,a2 or a3 see what happens
0
mdazgt Posts 8 Registration date Monday July 14, 2014 Status Member Last seen July 19, 2014
Jul 15, 2014 at 10:53 AM
this empty rows can be done by small resharch with menus in excel data sheet or an
xls file
0
mdazgt Posts 8 Registration date Monday July 14, 2014 Status Member Last seen July 19, 2014
Jul 15, 2014 at 11:05 AM
this empty rows can be done by small resherch with menus in excel sheet or an xls file

you can exceed the row next by the same option

or else

many more times empty rows by the same opyion
0