Insert Rows based on Countif results

NBVC

Well-known Member
Joined
Aug 31, 2005
Messages
5,828
Hi everyone,

I am trying to insert rows based on the result of Countif's. How would I go about doing this using VBA....still trying to grasp many VBA concepts.

In Sheet1 I have a bunch of names in A1:A30, many are duplicates.

In Sheet2 I have a unique list of names that are found in sheet 1. This list is in A1:A5

Starting at A10, I want to insert the name in A1 and insert rows below = the number of times that name is found in Sheet1!A1:A30. Immediately following I will insert next name and repeat procedure until all names have been cycled through.

Thanks in advance.
 
NBVC

As far as I can see that piece of code is just replacing the formula with the value.
 
Upvote 0

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Gates

It's nothing to do with the resize or offset, the key thing is Value.:)
 
Upvote 0
NBVC

As far as I can see that piece of code is just replacing the formula with the value.

You are right, Norie.

If I comment that line out, then I do see the formulas in the spreadsheet.

If I leave the statement, I see the values only.

Thanks.
 
Upvote 0

Forum statistics

Threads
1,215,636
Messages
6,125,961
Members
449,276
Latest member
surendra75

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