Selecting and deleting named range in Workbook

kapilg89

New Member
Joined
Dec 12, 2012
Messages
30
Hello

I have been writing a code to select all the sheets in my workbook and then delete the cells in which data has to be input to create a new blank template every time to reuse.
I named the range in which data can be input as "NeedDel" whose scope is restricted to the sheet itself.
The purpose of this code is that it will delete the data contained in the range "NeedDel" and make it blank to be used to create a new blank template.

I wrote the following code:

Code:
Sub NeedDel()
Sheets("Summary_Sheet_FC").Range("NeedDel").Select
Sheets("Summary_Sheet_INR").Range("NeedDel").Select
Sheets("Procured_Parts_&_Matls_3").Range("NeedDel").Select
Sheets("Process_4").Range("NeedDel").Select
Sheets("Logistics_&_Others_5").Range("NeedDel").Select        Selection.ClearContents    
Sheets("Summary_Sheet_FC").Range("M8").Select
End Sub

But it didn't work as expected can you please help
 
Last edited:

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Code:
Sub NeedDel()
Sheets("Summary_Sheet_FC").Range("NeedDel").ClearContents
Sheets("Summary_Sheet_INR").Range("NeedDel").ClearContents
Sheets("Procured_Parts_&_Matls_3").Range("NeedDel").ClearContents
Sheets("Process_4").Range("NeedDel").ClearContents
Sheets("Logistics_&_Others_5").Range("NeedDel").ClearContents  
Sheets("Summary_Sheet_FC").Range("M8").Select
End Sub
 
Upvote 0

Forum statistics

Threads
1,216,119
Messages
6,128,947
Members
449,480
Latest member
yesitisasport

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