Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Script entry to add a new worksheet


Hi,

Could some kind person/people offer both specific and generic help with
Worksheet properties and events in script, but also specific help with

Moving from one worksheet to another, renaming worksheets tags and adding a
named worksheet.

I am a novice to Excel Scripting, although quite experienced with
spreadsheets since Lotus 123 (DOS).
--
Knowledge when shared becomes a gift. Thank you for your bounty.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Script entry to add a new worksheet


Set the Security level to low/medium in (Tools|Macro|Security). From workbook
launch VBE using short-key Alt+F11. From menu 'Insert' a module and paste the
below code. Save. Get back to Workbook. Run macro from Tools|Macro|Run
<selected macro()..

Sub AddNewWorksheet()
Dim ws As Worksheet
Set ws = ActiveWorkbook.Sheets.Add(After:=ActiveSheet)
ws.Name = "NewName"
End Sub

Sub LoopthroughSheets()
For Each wsTemp In ActiveWorkbook.Sheets
MsgBox wsTemp.Name
wsTemp.Name = wsTemp.Name & "New"
Next
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"oshanter" wrote:

Hi,

Could some kind person/people offer both specific and generic help with
Worksheet properties and events in script, but also specific help with

Moving from one worksheet to another, renaming worksheets tags and adding a
named worksheet.

I am a novice to Excel Scripting, although quite experienced with
spreadsheets since Lotus 123 (DOS).
--
Knowledge when shared becomes a gift. Thank you for your bounty.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Script entry to add a new worksheet


Try the below 2 macros

Set the Security level to low/medium in (Tools|Macro|Security). From
workbook launch VBE using short-key Alt+F11. From menu 'Insert' a module and
paste the below code. Save. Get back to Workbook. Run macro from
Tools|Macro|Run <selected macro()

Sub InserNewSheet()
Dim ws As Worksheet
Set ws = ActiveWorkbook.Sheets.Add(After:=ActiveSheet)
ws.Name = "NewName"
End Sub

Sub LoopThroughSheets()
For Each wsTemp In ActiveWorkbook.Sheets
MsgBox wsTemp.Name
wsTemp.Name = wsTemp.Name & "New"
Next
End Sub

--
If this post helps click Yes
---------------
Jacob Skaria


"oshanter" wrote:

Hi,

Could some kind person/people offer both specific and generic help with
Worksheet properties and events in script, but also specific help with

Moving from one worksheet to another, renaming worksheets tags and adding a
named worksheet.

I am a novice to Excel Scripting, although quite experienced with
spreadsheets since Lotus 123 (DOS).
--
Knowledge when shared becomes a gift. Thank you for your bounty.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Script entry to add a new worksheet


Jacob,

Thank you.

Tom
--
Knowledge shared is a gift. Thanks for your gift to me.


"Jacob Skaria" wrote:

Try the below 2 macros

Set the Security level to low/medium in (Tools|Macro|Security). From
workbook launch VBE using short-key Alt+F11. From menu 'Insert' a module and
paste the below code. Save. Get back to Workbook. Run macro from
Tools|Macro|Run <selected macro()

Sub InserNewSheet()
Dim ws As Worksheet
Set ws = ActiveWorkbook.Sheets.Add(After:=ActiveSheet)
ws.Name = "NewName"
End Sub

Sub LoopThroughSheets()
For Each wsTemp In ActiveWorkbook.Sheets
MsgBox wsTemp.Name
wsTemp.Name = wsTemp.Name & "New"
Next
End Sub

--
If this post helps click Yes
---------------
Jacob Skaria


"oshanter" wrote:

Hi,

Could some kind person/people offer both specific and generic help with
Worksheet properties and events in script, but also specific help with

Moving from one worksheet to another, renaming worksheets tags and adding a
named worksheet.

I am a novice to Excel Scripting, although quite experienced with
spreadsheets since Lotus 123 (DOS).
--
Knowledge when shared becomes a gift. Thank you for your bounty.

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
script to increase last number in cell entry for hyperlink kim Excel Programming 1 January 3rd 08 12:01 PM
Script - Create New Worksheet Jeff C Excel Discussion (Misc queries) 6 May 17th 07 03:49 PM
How do I turn a VBA script on and off with an entry in a cell ffzeus Excel Programming 2 February 17th 06 12:52 AM
Help in adding XML maps to a worksheet using a script roblo[_4_] Excel Programming 0 August 24th 05 06:01 PM
Date Entry Script Larry Townsend Excel Programming 1 January 30th 04 10:21 AM


All times are GMT +1. The time now is 12:44 PM.

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

About Us

"It's about Microsoft Excel"