Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default creatin new sheet macro

Hi!
Is it possible to have a macro that creat a new sheet and puts it first in
the workbook like this:

I have one sheet named: kvartal1
The macro creats a sheet named kvartal2. If I run it again it creats
kvartal3... and so on.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 246
Default creatin new sheet macro

This might work for you:

'+++++++++++++++++++++++++
Dim mySheet As Worksheet
Set mySheet = Sheets.Add(Sheets(1))
mySheet.Name = "Kvartal" & Sheets.Count
'+++++++++++++++++++++++++

Rgds
J

On Oct 18, 1:36 pm, Calle wrote:
Hi!
Is it possible to have a macro that creat a new sheet and puts it first in
the workbook like this:

I have one sheet named: kvartal1
The macro creats a sheet named kvartal2. If I run it again it creats
kvartal3... and so on.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default creatin new sheet macro

hi!
it get named "kvartal 10" since I also have many other sheets. Any other
suggestion

Regards Calle
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default creatin new sheet macro

Dim mySheet As Worksheet
Set mySheet = Sheets.Add(Sheets(1))
mySheet.Name = "Kvartal" & Sheets.Count - 9

--
Regards,
Tom Ogilvy


"Calle" wrote in message
...
hi!
it get named "kvartal 10" since I also have many other sheets. Any other
suggestion

Regards Calle



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 lookup a sheet, number, then display in origonal sheet abbsy3 New Users to Excel 3 November 9th 10 12:19 PM
Return to Current Sheet in On (sheet activate) event macro Paul Moles Excel Programming 1 March 27th 05 03:16 PM
2 questions, copying data from sheet to sheet and assigning macro Boris Excel Worksheet Functions 0 December 16th 04 06:11 PM
How to create a Macro to Copy Information in one sheet to another sheet. poppy Excel Programming 3 July 28th 04 07:26 AM
excel - macro code to open a protected sheet, enter passowrd, and then protect sheet arunjoshi[_5_] Excel Programming 1 May 2nd 04 03:50 PM


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