Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro to Create Sheet & Duplicate Sheet


Hi,
could anyone tell me how - in a VB macro - to :
1) Create a sheet
In a Workbook, I have one Sheet called "Sheet1"
If on "Sheet1" Cell A1 = TOTO a macro will *create* a sheet calle
TOTO

2) Duplicate a sheet
If on "Sheet1" Cell A1 = TITI a macro will *duplicate* "sheet 1"

Regards

Herv

--
Herve_Ro
-----------------------------------------------------------------------
Herve_Rob's Profile: http://www.excelforum.com/member.php...fo&userid=3520
View this thread: http://www.excelforum.com/showthread.php?threadid=54968

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro to Create Sheet & Duplicate Sheet


Sub Macro()

If Sheets("Sheet1").Range("A1").Value = "TOTO" Then

Sheets.Add
With ActiveSheet
Name = "TOTO"
End With

Sheets("Sheet1").Select

End If

If Sheets("Sheet1").Range("A1").Value = "TITI" Then

Sheets("Sheet1").Select
Sheets("Sheet1").Copy Befo=Sheets(2)

End If

End Sub


--
Bearacade


------------------------------------------------------------------------
Bearacade's Profile: http://www.excelforum.com/member.php...o&userid=35016
View this thread: http://www.excelforum.com/showthread...hreadid=549682

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
Macro to create new sheet Kim Excel Discussion (Misc queries) 5 April 25th 09 02:51 AM
Duplicate sheet, autonumber sheet, record data on another sheet des-sa[_2_] Excel Worksheet Functions 0 May 8th 08 06:56 PM
Macro - to copy duplicate rows to another sheet [email protected] Excel Worksheet Functions 2 April 19th 05 01:53 AM
How to create a Macro to Copy Information in one sheet to another sheet. poppy Excel Programming 3 July 28th 04 07:26 AM
Do you know how to create a new sheet in a file by macro? dukejas[_2_] Excel Programming 2 November 8th 03 12:56 AM


All times are GMT +1. The time now is 10:40 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"