![]() |
How to add new sheet with certain name?
Hi, I'd like to run a macro that select datas that meet certain criteri and place them in new sheets. How can I create new sheets and give nam according to the criteria selected. I'm afraid I couldn't write in a correct language but let's put it lik this example. I've a sheet that contains a long list of fruits (apple bananas, kiwis etc). Then I'd like to run a macro that put apples in a Apple2005_08, bananas in Banana2005_08 and so on, where 2005 is curren year and 08 is current month. How can I name sheets with this pattern? Your help are much appreciated. hideki ps: I'm using Excel 200 -- hidek ----------------------------------------------------------------------- hideki's Profile: http://www.excelforum.com/member.php...fo&userid=1890 View this thread: http://www.excelforum.com/showthread.php?threadid=39503 |
How to add new sheet with certain name?
Hi,
Without seeing any of your code, here is a simple way to name the sheets with the format you describe ... With Sheets(1) .Name = .Range("A1").Value & Year(Date) & "_" & Format(Month(Date), "mm") End With Change the first "Sheets(1)" to whatever sheet you want to rename. HTH -- Regards, Zack Barresse, aka firefytr "hideki" wrote in message ... Hi, I'd like to run a macro that select datas that meet certain criteria and place them in new sheets. How can I create new sheets and give name according to the criteria selected. I'm afraid I couldn't write in a correct language but let's put it like this example. I've a sheet that contains a long list of fruits (apple, bananas, kiwis etc). Then I'd like to run a macro that put apples in an Apple2005_08, bananas in Banana2005_08 and so on, where 2005 is current year and 08 is current month. How can I name sheets with this pattern? Your help are much appreciated. hideki ps: I'm using Excel 2000 -- hideki ------------------------------------------------------------------------ hideki's Profile: http://www.excelforum.com/member.php...o&userid=18903 View this thread: http://www.excelforum.com/showthread...hreadid=395035 |
How to add new sheet with certain name?
Here is how you add a sheet and give it a name (based on the value in Cell A1
of the activesheet and the current year and month) dim wksActive as worksheet dim wksNew as worksheet set wksActive = activesheet set wksnew = worksheets.add wksnew.name = wksactive.range("A1").value & year(date()) & "-" & month(date()) -- HTH... Jim Thomlinson "hideki" wrote: Hi, I'd like to run a macro that select datas that meet certain criteria and place them in new sheets. How can I create new sheets and give name according to the criteria selected. I'm afraid I couldn't write in a correct language but let's put it like this example. I've a sheet that contains a long list of fruits (apple, bananas, kiwis etc). Then I'd like to run a macro that put apples in an Apple2005_08, bananas in Banana2005_08 and so on, where 2005 is current year and 08 is current month. How can I name sheets with this pattern? Your help are much appreciated. hideki ps: I'm using Excel 2000 -- hideki ------------------------------------------------------------------------ hideki's Profile: http://www.excelforum.com/member.php...o&userid=18903 View this thread: http://www.excelforum.com/showthread...hreadid=395035 |
How to add new sheet with certain name?
Hi
You can use a macro to do this Change the naming of the sheets in the example code http://www.rondebruin.nl/copy5.htm -- Regards Ron de Bruin http://www.rondebruin.nl "hideki" wrote in message ... Hi, I'd like to run a macro that select datas that meet certain criteria and place them in new sheets. How can I create new sheets and give name according to the criteria selected. I'm afraid I couldn't write in a correct language but let's put it like this example. I've a sheet that contains a long list of fruits (apple, bananas, kiwis etc). Then I'd like to run a macro that put apples in an Apple2005_08, bananas in Banana2005_08 and so on, where 2005 is current year and 08 is current month. How can I name sheets with this pattern? Your help are much appreciated. hideki ps: I'm using Excel 2000 -- hideki ------------------------------------------------------------------------ hideki's Profile: http://www.excelforum.com/member.php...o&userid=18903 View this thread: http://www.excelforum.com/showthread...hreadid=395035 |
How to add new sheet with certain name?
Hi all, Thank you for all the replies. It works perfectly as I desired. really appreciated all of them. Thanks for your kindness. hidek -- hidek ----------------------------------------------------------------------- hideki's Profile: http://www.excelforum.com/member.php...fo&userid=1890 View this thread: http://www.excelforum.com/showthread.php?threadid=39503 |
All times are GMT +1. The time now is 12:28 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com