View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jacob Skaria Jacob Skaria is offline
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.