Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 124
Default 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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default 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


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
excel sheet bootom half sheet goes behind top part of sheet rob Excel Worksheet Functions 2 January 17th 09 01:28 AM
Duplicate sheet, autonumber sheet, record data on another sheet des-sa[_2_] Excel Worksheet Functions 0 May 8th 08 06:56 PM
How do I select price from sheet.b where sheet.a part no = sheet.b Sonny Excel Worksheet Functions 4 April 4th 06 05:08 PM
relative sheet references ala sheet(-1)!B11 so I can copy a sheet. RonMc5 Excel Discussion (Misc queries) 9 February 3rd 05 12:51 AM
Inserting a row in sheet A should Insert a row in sheet B, removing a row in Sheet A should remove the corresponding row in sheet B Hannes Heckner Excel Programming 1 March 5th 04 09:10 AM


All times are GMT +1. The time now is 11:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"