Reset button clearing all data

EBahn

New Member
Joined
Mar 3, 2023
Messages
5
Office Version
  1. 2016
Platform
  1. MacOS
I had an IF formula where I wanted to add a text if aa value was "0", all worked great but when I ran the VBA to reset or clear data- It's a calc sheet- the If function formula disappears too.
What can I do to remove that? The cells that i want the IF are in M15-23. Any thoughts or ideas?

Sub ClearData()


Worksheets("DESIGN").Range("C15").Value = "NONE"
Worksheets("DESIGN").Range("C17").Value = "No Pic"
Worksheets("DESIGN").Range("C18").Value = "No Sic"
Worksheets("DESIGN").Range("K7").Value = ""
Worksheets("DESIGN").Range("d6").Value = ""
Worksheets("DESIGN").Range("d6").Value = ""
Worksheets("DESIGN").Range("G16").Value = "'"
Worksheets("DESIGN").Range("m15:m23").Value = "'"
Worksheets("DESIGN").Range("n15:n23").Value = "'"
Worksheets("DESIGN").Range("g18").Value = ""
Worksheets("DESIGN").Range("k6").Value = ""
Worksheets("DESIGN").Range("p24:p27").Value = ""
Worksheets("DESIGN").Range("d28").Value = ""
Worksheets("DESIGN").Range("O15:O23").Value = ""
Worksheets("DESIGN").Range("P15:P23").Value = ""
Worksheets("DESIGN").Range("N71:N72").Value = ""
Worksheets("DESIGN").Range("N74:N75").Value = ""
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Hi & welcome to MrExcel.
Just remove this line
VBA Code:
Worksheets("DESIGN").Range("m15:m23").Value = "'"
 
Upvote 0

Forum statistics

Threads
1,215,328
Messages
6,124,295
Members
449,149
Latest member
mwdbActuary

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