Clear contents of cells

trebor1956

Board Regular
Joined
Jul 2, 2015
Messages
100
Office Version
  1. 2013
Platform
  1. Windows
Hi,

I have a macro to clear cell contents. However, when I create a copy of the workbook and change the names of the worksheets the sheet names within the macro are not updated so it fails.Is there a way to have the same generic macro in all my related workbooks that will clear cell contents (identical cell range) even when the worksheet name has changed. In this case the worksheet name has the month year (mmm yyyy) within its name.
To try and explain further, I have a workbook for Jan 2018 with sheets called 'nn Jan 2018' etc. where nn is a persons initial. At the end of the month I will then copy the workbook, rename the sheets (via a macro) to 'nn Feb 2018'. There will be entries within cell range D7:E41 that will need clearing so I was hoping to have a generic macro that would do this even when the sheet names change.

many thanks,
trebor1956
 
In this example of yours:

Summary Apr 2018
Dates Apr 2018
RF Apr 2018

<tbody>
</tbody>

Is the word "Summary" some place on the sheet?

For example do you have Summary in Range(A1) of the sheet named Summary Apr 2018

And
RF in Range(A1) of sheet named
RF Apr 2018
<strike></strike>

Hi,
Sorry its taken so long to reply I have been away on holiday. To answer your question, Column A is empty in all the sheets that need renaming, does this help or hinder?

Trebor1956
 
Upvote 0

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.
Hi,
Are you able to
write you a script to rename all your sheets each month. Without you having to always enter all your old sheet names and how you want all your new sheets name to look now you have the info. above?
 
Upvote 0

Forum statistics

Threads
1,216,157
Messages
6,129,195
Members
449,493
Latest member
JablesFTW

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