Insert Rows in a one click

Vaja

New Member
Joined
Mar 18, 2022
Messages
13
Office Version
  1. 2016
Platform
  1. Windows
I want to Insert rows, above those rows with a zero value (2,5,10,13,17,24,28,30) in one time ??


1 major_use_of_pesticides_insecticides.xlsx
BCDEFG
1123456
2Abamectin 01.90% EC00000
3Rose (Ornamental)Red spider mites (Tetranychus urticae)0.00048- 0.00096%0.025-0.050%5003
4GrapesMites0.014/L0.75 ml/L water500-10003
5Acephate 75.00% SP00000
6CottonJassids292390500-100015
7CottonBollworms584780500-100015
8SafflowerAphids584780500-100015
9Rice (Paddy)Yellow stem borer, Leaf folder, Plant Hoppers, Green leaf hopper500.0-750.0666.0-1000.0300-50015
10Acephate 97.00% DF00000
11CottonJassids & Boll worm complex436.50 -582.00450.0-600.050048
12Paddy (Rice)Yellow stem borer, Leaf folder, Plant hoppers, Green leaf hopper727.575050021
13Acephate 95.00% SG00000
14Rice (Paddy)Stem borer, Leaf folder, Brown plant hopper562.559250030
15CottonJassids75079050018
16ChilliThrips, Fruit borer (Helicoverpa armigera) Aphid7507905007
17Acetamiprid 20.00% SP00000
18CottonAphids, Jassids1050500-60015
19CottonWhiteflies20100500-60015
20CabbageAphids1575500-6007
21Okra (Bhindi)Aphids1575500-6003
22ChilliThrips10.00-20.0050.0-100.0500-6003
23Rice (Paddy)Brown plant hopper10.00-20.0050.0-100.0500-6007
24Afidopyropen 50 g/L DC00000
25BrinjalWhitefly, Jassids501000500-7501
26CottonWhitefly, Jassids501000500-75025
27CucumberWhitefly35.00-50.00700-10005005
28Alphacypermethrin 10.00% EC00000
29CottonBoll Worms15.00-25.00165.0-280.0600-10007
30Alphacypermethrin 10.00% SC00000
31CottonBoll Worms25.00-30.00250.0-300.0500-100010
Sheet4
 
Since Column B is all text except for your zeros, and since two consecutive rows will not have zeros in Column B, you can do what you want with just a single line of code...
VBA Code:
Sub InsertBlankRowsAboveZeros()
  Range("B2", Cells(Rows.Count, "B").End(xlUp)).SpecialCells(xlConstants, xlNumbers).EntireRow.Insert
End Sub
 
Upvote 0

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.

Forum statistics

Threads
1,215,452
Messages
6,124,916
Members
449,195
Latest member
Stevenciu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top