Inserting Blank rows based on cells values - VBA code

JoeRooney

Board Regular
Joined
Nov 27, 2017
Messages
171
Office Version
  1. 365
Hi,


I currently have a task where I need to calculate thedifference between two sets of data,

The problem is I want to break it down per policy.

For example one policy could have 3 inputs in one set ofdata but only one in the other.

A policy could also appear in one set of data but not theother.

At the minute I am inserting a blank row like the example belowto identify the differences. This is a very manual task and I am sure there isa better way to accomplish what I am doing.

I was wondering could someone help me with some code I coulduse or maybe guide me on the best way to approach this, maybe a pivot.

Any help is greatly appreciated.

Below are examples of my original data and my data followingmy input?

Thanks,


[TABLE="width: 288"]
<colgroup><col width="64" style="width: 48pt;" span="3"> <col width="64" style="width: 48pt;" span="3"> <tbody>[TR]
[TD="width: 64, bgcolor: #FCE4D6"]Policy[/TD]
[TD="width: 64, bgcolor: #FCE4D6"]€[/TD]
[TD="width: 64, bgcolor: #FCE4D6"]Type[/TD]
[TD="width: 64, bgcolor: #FCE4D6"]Policy [/TD]
[TD="width: 64, bgcolor: #FCE4D6"]Type[/TD]
[TD="width: 64, bgcolor: #FCE4D6"]€[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]AA[/TD]
[TD="bgcolor: transparent"] € 1.00 [/TD]
[TD="bgcolor: transparent"] LSR [/TD]
[TD="bgcolor: transparent"]AA[/TD]
[TD="bgcolor: transparent"]LSR[/TD]
[TD="bgcolor: transparent"] € 1.00 [/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]AA[/TD]
[TD="bgcolor: transparent"] € 1.00 [/TD]
[TD="bgcolor: transparent"] LSR [/TD]
[TD="bgcolor: transparent"]BB[/TD]
[TD="bgcolor: transparent"]PCP[/TD]
[TD="bgcolor: transparent"] € 1.00 [/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]CC[/TD]
[TD="bgcolor: transparent"] € 1.00 [/TD]
[TD="bgcolor: transparent"] PCP [/TD]
[TD="bgcolor: transparent"]CC[/TD]
[TD="bgcolor: transparent"]PCP[/TD]
[TD="bgcolor: transparent"] € 1.00 [/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]dd[/TD]
[TD="bgcolor: transparent"] € 1.00 [/TD]
[TD="bgcolor: transparent"] LSR [/TD]
[TD="bgcolor: transparent"]dd[/TD]
[TD="bgcolor: transparent"]LSR[/TD]
[TD="bgcolor: transparent"] € 1.00 [/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]dd[/TD]
[TD="bgcolor: transparent"] € 1.00 [/TD]
[TD="bgcolor: transparent"] LSR [/TD]
[TD="bgcolor: transparent"]ee[/TD]
[TD="bgcolor: transparent"]B2B[/TD]
[TD="bgcolor: transparent"] € 1.00 [/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]dd[/TD]
[TD="bgcolor: transparent"] € 1.00 [/TD]
[TD="bgcolor: transparent"] LSR [/TD]
[TD="bgcolor: transparent"]ff[/TD]
[TD="bgcolor: transparent"]LSR[/TD]
[TD="bgcolor: transparent"] € 1.00 [/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="bgcolor: #FCE4D6"]Policy[/TD]
[TD="bgcolor: #FCE4D6"]€[/TD]
[TD="bgcolor: #FCE4D6"]Type[/TD]
[TD="bgcolor: #FCE4D6"]Policy [/TD]
[TD="bgcolor: #FCE4D6"]Type[/TD]
[TD="bgcolor: #FCE4D6"]€[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]AA[/TD]
[TD="bgcolor: transparent"] € 1.00 [/TD]
[TD="bgcolor: transparent"] LSR [/TD]
[TD="bgcolor: #D9D9D9"] [/TD]
[TD="bgcolor: #D9D9D9"] [/TD]
[TD="bgcolor: #D9D9D9"] [/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]AA[/TD]
[TD="bgcolor: transparent"] € 1.00 [/TD]
[TD="bgcolor: transparent"] LSR [/TD]
[TD="bgcolor: transparent"]AA[/TD]
[TD="bgcolor: transparent"]LSR[/TD]
[TD="bgcolor: transparent"] € 1.00 [/TD]
[/TR]
[TR]
[TD="bgcolor: #D9D9D9"] [/TD]
[TD="bgcolor: #D9D9D9"] [/TD]
[TD="bgcolor: #D9D9D9"] [/TD]
[TD="bgcolor: transparent"]BB[/TD]
[TD="bgcolor: transparent"]PCP[/TD]
[TD="bgcolor: transparent"] € 1.00 [/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]CC[/TD]
[TD="bgcolor: transparent"] € 1.00 [/TD]
[TD="bgcolor: transparent"] PCP [/TD]
[TD="bgcolor: transparent"]CC[/TD]
[TD="bgcolor: transparent"]PCP[/TD]
[TD="bgcolor: transparent"] € 1.00 [/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]dd[/TD]
[TD="bgcolor: transparent"] € 1.00 [/TD]
[TD="bgcolor: transparent"] LSR [/TD]
[TD="bgcolor: transparent"]dd[/TD]
[TD="bgcolor: transparent"]LSR[/TD]
[TD="bgcolor: transparent"] € 1.00 [/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]dd[/TD]
[TD="bgcolor: transparent"] € 1.00 [/TD]
[TD="bgcolor: transparent"] LSR [/TD]
[TD="bgcolor: #D9D9D9"] [/TD]
[TD="bgcolor: #D9D9D9"] [/TD]
[TD="bgcolor: #D9D9D9"] [/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]dd[/TD]
[TD="bgcolor: transparent"] € 1.00 [/TD]
[TD="bgcolor: transparent"] LSR [/TD]
[TD="bgcolor: #D9D9D9"] [/TD]
[TD="bgcolor: #D9D9D9"] [/TD]
[TD="bgcolor: #D9D9D9"] [/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]ee[/TD]
[TD="bgcolor: transparent"] € 1.00 [/TD]
[TD="bgcolor: transparent"] B2B [/TD]
[TD="bgcolor: transparent"]ee[/TD]
[TD="bgcolor: transparent"]B2B[/TD]
[TD="bgcolor: transparent"] € 1.00 [/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]ff[/TD]
[TD="bgcolor: transparent"] € 1.00 [/TD]
[TD="bgcolor: transparent"] LSR [/TD]
[TD="bgcolor: #D9D9D9"] [/TD]
[TD="bgcolor: #D9D9D9"] [/TD]
[TD="bgcolor: #D9D9D9"] [/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]gg[/TD]
[TD="bgcolor: transparent"] € 2.00 [/TD]
[TD="bgcolor: transparent"] LSR [/TD]
[TD="bgcolor: transparent"]gg[/TD]
[TD="bgcolor: transparent"]LSR[/TD]
[TD="bgcolor: transparent"] € 1.00 [/TD]
[/TR]
</tbody>[/TABLE]




 

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,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

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