Custom formula to count rows in columns a find the difference

catharsis50

New Member
Joined
Nov 1, 2011
Messages
46
My goal is to insert a dynamic amount of rows to a table. The number of rows I need to insert will be the difference of rows from columnA on sheet1 to the number of rows in columnA on sheet2. I am assuming creating a function within my macro will be the best way to go about this.

I appreciate any help or suggestions on this.
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
I figured out a way for it to work in my case, hopefully it will help someone else.

Dim row1 As Long, row2 As Long, rrow2 As Long, diff As Long
row1 = Sheets("Deduped Campaign Data").Cells(Rows.Count, "A").End(xlUp).Row
row2 = Sheets("Dashboard").Cells(Rows.Count, "A").End(xlUp).Row
diff = row1 - row2

Sheets("Dashboard").Select
Range("A2").End(xlDown).Select
ActiveCell.Offset(1, 0).Select
ActiveCell.EntireRow.Resize(diff).Insert
 
Upvote 0

Forum statistics

Threads
1,223,900
Messages
6,175,276
Members
452,629
Latest member
SahilPolekar

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