Copy paste Special values when some rows are hidden

Nick70

Active Member
Joined
Aug 20, 2013
Messages
299
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have a formula in cells in range (C6:C50) which returns a number.
Some of the rows in range (C6:C50) are hidden due to a filter being in place.

I would like to copy/ paste special values the formulas in this range (C6:C50) so we have a value and not a formula (either for all unhidden rows or for all rows in range (C6:C50) it makes no difference).

Problem is that because some of the rows in range are hidden (due to filter) this means that when I copy/ paste special values I get message 'You can't paste this here because the Copy area and paste area aren't the same size'.

Is there a way for me to copy/ paste special values the formulas without having to clear the filter (and unhide all hidden rows)?
The filter setting is quite complex so clearing the filter is not an option.

Thanks,
N.

:unsure: :unsure:
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Do you mean you want to replace formulas in C6:C50 with their values?
Because the range is filtered then you need to loop through it:
VBA Code:
Sub to_value()
Dim c As Range

For Each c In Range("C6:C50")
    c.Value = c.Value
Next

End Sub
 
Upvote 0
Solution
You're welcome, glad to help & thanks for the feedback.:)
 
Upvote 0

Forum statistics

Threads
1,215,133
Messages
6,123,235
Members
449,092
Latest member
SCleaveland

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