How to exclude the value 0,00 or 0.00 from being copied

Romano_odK

Active Member
Joined
Jun 4, 2020
Messages
379
Office Version
  1. 365
Platform
  1. Windows
Good afternoon,

Using this code I can copy values from one column to another. Now I would like to exclude the values 0,00 or 0.00 from being copied. Can this be done?

Thank you for your time.

Romano

Range("D9", Cells(Rows.Count, "D").End(xlUp)).Copy

Worksheets("OPXML").Range("C9").PasteSpecial Paste:=xlPasteValues, SkipBlanks:=False
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Not knowing how your data looks like, but you could do a filter first. Make sure you data has a header in D9

VBA Code:
Sub jec()
 Application.ScreenUpdating = False
 With Range("D9", Cells(Rows.Count, "D").End(xlUp))
   .AutoFilter 1, "<>0.00", xlAnd, "<>0,00"
   .Offset(1).Copy
    Sheets("OPXML").Range("C9").PasteSpecial xlPasteValues
   .AutoFilter
 End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,429
Messages
6,124,843
Members
449,193
Latest member
MikeVol

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