Deleting 0 after refresh

Romano_odK

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

In a table I have the columns C until O who are filled from a SQL after a refresh. In that refresh some cells are filles with a "zero". Is it possible to erase all the cells where there is only one zero?


Thank you for you time and efforts.


Directory:C:\temp\100MRP.xmlLast refreshDateWeek
22/02/2024 17:0022/028
ArtikelcodeOmschrijving02/202303/202304/202305/202306/202307/202308/202309/202310/202311/202312/202301/202402/2024
itemcodedescriptionq-12q-11q-10q-9q-8q-7q-6q-5q-4q-3q-2q-1q-0
100000Vito Glaserfix 111 6x2 mm wit - 10x25 m161616165018215321317
100001Vito Glaserfix 111 6x2 mm zwart - 10x25 m801636162617
100002Vito Glaserfix 111 6x3 mm wit - 10x25 m806217324818371632332
100003Vito Glaserfix 111 6x3 mm zwart - 10x25 m482112116321621177
100004Vito Glaserfix 111 6x4 mm wit - 10x25 m16-161616
100005Vito Glaserfix 111 6x4 mm zwart - 10x25 m16-1616
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
No I really need empty cells, not hiding.
Can you explain for what purpose?
If we know exactly what you need to do with them, and why they need to be this way, we can provide you with the best answer for your situation.
 
Upvote 0
Can you explain for what purpose?
If we know exactly what you need to do with them, and why they need to be this way, we can provide you with the best answer for your situation.
This piece is part of a large sheet that is used to eventually import an XML into our propriety software. A "zero" has a value for a SQL server and so this collides with the software we use, its needs to be empty for that. I do know how to explain it otherwise, but with a refresh these zero's are downloaded from the SQL server but do not need to go back.
 
Upvote 0
OK, how about just selecting the entire range that you want to apply it to, and do a Find/Replace, replacing 0 with nothing?
As long as you check the "Match entire cell contents" check box, it will only remove the entries that have EXACTLY 0 in them, and not any that have zeroes in larger numbers (like 10, 107, etc).

1708620313612.png
 
Upvote 0
OK, how about just selecting the entire range that you want to apply it to, and do a Find/Replace, replacing 0 with nothing?
As long as you check the "Match entire cell contents" check box, it will only remove the entries that have EXACTLY 0 in them, and not any that have zeroes in larger numbers (like 10, 107, etc).

View attachment 107317
We now erase all the cells by hand this way, but it would be a great benefit if this was an automated process. Since we have to do this all the time since we refresh this sheet very often. So that's why it would be a great help if this was done automatically.
 
Upvote 0
We now erase all the cells by hand this way, but it would be a great benefit if this was an automated process. Since we have to do this all the time since we refresh this sheet very often. So that's why it would be a great help if this was done automatically.
You can do the Find/Replace method with VBA. If you turn on your Macro Recorder and record yourself doing those steps manually, you will have most of the VBA code you need to do this.
(The Macro Recorder is a great tool to get VBA code, especially for people who are new to VBA - I highly recommend you start using it!).

If you need to make it more dynamic based on changing range sizes, then you will need to tell us how we can determine the size of the range to apply it to.
- What columns should be included?
- What row does the data you want to replace start on?
- What column can we look at to determine the last row of data that needs to be included (for example, if every row with data has something in column A, then we can look at column to determine the last row of data)?
 
Upvote 0
You can do the Find/Replace method with VBA. If you turn on your Macro Recorder and record yourself doing those steps manually, you will have most of the VBA code you need to do this.
(The Macro Recorder is a great tool to get VBA code, especially for people who are new to VBA - I highly recommend you start using it!).

If you need to make it more dynamic based on changing range sizes, then you will need to tell us how we can determine the size of the range to apply it to.
- What columns should be included?
- What row does the data you want to replace start on?
- What column can we look at to determine the last row of data that needs to be included (for example, if every row with data has something in column A, then we can look at column to determine the last row of data)?
Good morning, thank you for your replay. I will start with that and see how this goes. Thank you and have a great day.
 
Upvote 0

Forum statistics

Threads
1,215,079
Messages
6,123,005
Members
449,092
Latest member
masterms

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