Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 425
Default workbook code - new sheet created...

Looking for workbook code that runs on each new sheet created.

Columns("A:A").Select
Selection.NumberFormat = "0"

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default workbook code - new sheet created...

How is the new sheet created, by code or manually?

---
Per

On 1 Maj, 21:28, "J.W. Aldridge" wrote:
Looking for workbook code that runs on each new sheet created.

* * Columns("A:A").Select
* * Selection.NumberFormat = "0"


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default workbook code - new sheet created...

activesheet.Columns("A").NumberFormat = "0"

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"J.W. Aldridge" wrote in message
...
Looking for workbook code that runs on each new sheet created.

Columns("A:A").Select
Selection.NumberFormat = "0"


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 425
Default workbook code - new sheet created...

from double clicking on a total in pivot table...
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default workbook code - new sheet created...

Hi
Insert this in the codesheet for ThisWorkbook.

Private Sub Workbook_NewSheet(ByVal Sh As Object)
sh.Columns("A:A").NumberFormat = "0"
End Sub

Best regards,
Per

On 1 Maj, 22:06, "J.W. Aldridge" wrote:
from double clicking on a total in pivot table...




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 425
Default workbook code - new sheet created...

exactly what I was looking for...

couldnt remember the "Sub Workbook_NewSheet" part.

Thanx!
Thanx too Mr. Don!
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
Code to change code in a sheet and workbook module Otto Moehrbach Excel Programming 11 November 11th 07 07:20 PM
Trying To Push Code For Worksheet_Change Into VBA-Created Workbook? (PeteCresswell) Excel Programming 1 July 6th 07 01:39 PM
new sheet created 'on the fly' from template in same workbook - H. MrT Excel Worksheet Functions 3 April 10th 05 08:30 PM
Adding Code to the This_workbook module of a created workbook RPIJG[_68_] Excel Programming 1 July 9th 04 06:35 PM
how do you select the "last" sheet (created) in a workbook Mark Kubicki Excel Programming 1 September 30th 03 03:08 AM


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