CountA in pasted data gives not expected result

wpryan

Well-known Member
Joined
May 26, 2009
Messages
534
Office Version
  1. 365
Platform
  1. Windows
I have some data that I want to copy from one worksheet to another. All of the cells have calculations in them. I select them, hit "copy" and then in the destination, hit "paste special" (values). I want to run some code to delete the data in rows where cells B:F are empty. However, when I test the CountA function in the worksheet level, I get an unexpected value... Even though there is nothing visible in the cells, it gives me a return of 5, so it seems that it is considering the formulas as values, even if they are not visibile in the cells. I'm curious where I'm going wrong...
 
If there are no formulae in the range you could replace that 1st loop with
VBA Code:
uRange.Value=uRange.Value
 
Upvote 0

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,791
Messages
6,121,611
Members
449,038
Latest member
apwr

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