Copy Range with Blank formula still shows in COUNT

uk747

Well-known Member
Joined
Jul 20, 2011
Messages
843
Office Version
  1. 365
Platform
  1. Windows
Hi

I'm copying Ranges using VBA or even manually and even if the result of a formula in the range is "" when pasted it shows up in the COUNT When I select the Column.

Only way to stop it showing in the Count is Filter the Column for Blanks, select them all and press delete

e.g.
Cell B2 is a, Cell B3 is b, Cell B4 is = =IF(B2="a","",B2)

When I highlight Column B the Count is 3 which is fine 2 values and a formula
However when I copy B2:B4 and Paste as Values in D2, when I highlight Colum D the count is still 3 even though Cell D4 shows as a blank when you select it. If I click on D4 and Press delete it shows as 2.

So when I copy Paste the Blank which is the result of a formula how can I paste so that it wont show up in a count when column is Selected

Code used in example above
VBA Code:
Range("B2:B4").Copy
Range("D2").PasteSpecial Paste:=xlPasteValues

Thanks
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

Forum statistics

Threads
1,224,825
Messages
6,181,190
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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