Paste special format empty cells too

RAJESH1960

Banned for repeated rules violations
Joined
Mar 26, 2020
Messages
2,313
Office Version
  1. 2019
Platform
  1. Windows
Hello Everyone,

This sheet contains data which I have copied from the workings of a sheet and pasted here using paste special values. I have inserted an additional column to check the totals if they are correct. I have given the formula as shown above. The Problem is if the amount is blank, which is in most of the cases, the calculation shows an error. I have to delete the whole blank cells manually each one of them. As the data is huge, it will be time consuming to do so. Can this be avoided .? Is there any way I could paste the data in such a way that the blank cells are not formatted. ?
Query Do not format blank cells.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAA
1CheckABCDEAmtGAmtIAmtKAmtMAmtOAmtQAmtSAmtUAmtWAmtYAmt
2-01-02-2021R1A-3751.00January3752.00Sunday-1.00
3#VALUE!03-02-2021P2B-675.00February674.00Monday1.00
4#VALUE!04-02-2021C3C-3500.00March3538.00Tuesday-38.00
5#VALUE!06-02-2021R4D-18000.00April18114.00Wednesday-114.00
6-07-02-2021P5E-24000.00May10000.00Thursday10000.00Sunday4000.00
7#VALUE!09-02-2021C6F18000.00June-20000.00Friday2000.00
8#VALUE!11-02-2021R7G-1180.00July1176.00Saturday4.00
9#VALUE!16-02-2021P8H-3600.00August3601.00Sunday-1.00
10#VALUE!17-02-2021C9I-12.00September6.00Monday6.00
11#VALUE!19-02-2021R10J-5148.00October5147.00Tuesday1.00
12#VALUE!22-02-2021P11K-11100.00November11110.00Wednesday-10.00
13#VALUE!22-02-2021R12L-8285.00December8284.00Thursday1.00
14-26-02-2021P13M7786.00January-1493.00Friday-3045.00Monday-3248.00
15#VALUE!27-02-2021C14N-10678.00February10674.00Saturday4.00
16#VALUE!28-02-2021R15O20000.00March-100.00Sunday-19900.00
Query Paste special selection
Cell Formulas
RangeFormula
A2:A16A2=SUM(G2+I2+K2+M2+O2+Q2+S2+U2+W2+Y2+AA2)
 
If you run this on the sheet after you have pasted the values, it will get rid of any nullstrings
VBA Code:
Sub Rajesh()
With ActiveSheet.UsedRange
   .Value = .Value
End With
End Sub
 
Upvote 0
Solution

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
If you run this on the sheet after you have pasted the values, it will get rid of any nullstrings
VBA Code:
Sub Rajesh()
With ActiveSheet.UsedRange
   .Value = .Value
End With
End Sub
Thanks Fluff. It worked. Now I will have to save as Excel micro enabled sheet.
 
Upvote 0
You can put that in a personal workbook & run it on any sheet in any workbook.
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0
It is still not clear what the problem is or how you're creating it to begin with.

Pastespecial formats only pastes formats, it is not possible for that to cause an error.

Pastespecial values will paste the values of the source cells, if you copy empty cells you will paste empty cells, if you copy formula blanks you will paste nullstrings.

The #VALUE! errors in your formulas are likely caused by nullstrings from copying formula blanks. Either of the suggested formulas will ignore the nullstrings and tread the cells as being empty (zero value).

If there is another problem then you will need to be more specific.
Thanks for responding Jsonb. I will try to be more specific next time.
 
Upvote 0

Forum statistics

Threads
1,224,824
Messages
6,181,187
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