Is there a macro to name the sheet the name of a cell, with a slight change?
e.g. the cell is : M-13.06.2005, and i want the sheet to be named M-13.06.05.
However i would like to name 5 days of the week, everytime the macro is run,
i.e. it names monday-friday each time.
any help would be hugely appreciated.
Bonbon
Just an example:In Sheet1, A1, enter: M-13.06.2005
In Sheet1, B1, enter: =REPLACE(A1,9,2,D1) amp; quot; quot;amp;TEXT(TODAY(),quot;DDDDDquot;)
Then enter and run the following macro:
Sub Macro1()
Sheets(quot;Sheet1quot;).Select
Sheets(quot;Sheet1quot;).Name = Range(quot;B1quot;).Value
End Sub
--
Gary''s Studentquot;Bonbonquot; wrote:
gt; Is there a macro to name the sheet the name of a cell, with a slight change?
gt; e.g. the cell is : M-13.06.2005, and i want the sheet to be named M-13.06.05.
gt; However i would like to name 5 days of the week, everytime the macro is run,
gt; i.e. it names monday-friday each time.
gt;
gt; any help would be hugely appreciated.
gt; Bonbon
Cool, but what should i do if i need it to name 5 days? Because that macro
changes one sheets name.
Thx again
quot;Gary''s Studentquot; wrote:
gt; Just an example:
gt;
gt;
gt; In Sheet1, A1, enter: M-13.06.2005
gt; In Sheet1, B1, enter: =REPLACE(A1,9,2,D1) amp; quot; quot;amp;TEXT(TODAY(),quot;DDDDDquot;)
gt;
gt; Then enter and run the following macro:
gt;
gt; Sub Macro1()
gt; Sheets(quot;Sheet1quot;).Select
gt; Sheets(quot;Sheet1quot;).Name = Range(quot;B1quot;).Value
gt; End Sub
gt;
gt; --
gt; Gary''s Student
gt;
gt;
gt; quot;Bonbonquot; wrote:
gt;
gt; gt; Is there a macro to name the sheet the name of a cell, with a slight change?
gt; gt; e.g. the cell is : M-13.06.2005, and i want the sheet to be named M-13.06.05.
gt; gt; However i would like to name 5 days of the week, everytime the macro is run,
gt; gt; i.e. it names monday-friday each time.
gt; gt;
gt; gt; any help would be hugely appreciated.
gt; gt; Bonbon
- Jan 24 Wed 2007 20:35
Macro problem
close
全站熱搜
留言列表
發表留言