Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Worksheets dilemma

Help! (please)

I have a workbook that is a Field Report. It starts with one visible sheet and when the user changes a certain cell to a particular piece of text a "new" sheet is "created" - in reality it is simply an existing sheet which is unhidden by the code. This "new" sheet is called "OEM". The workbook has lots of VBA code for Workbook_BeforeSave which checks that some mandatory cells have been completed on OEM and other sheets. All is working well. But . . . It may be that the user wants to create another OEM sheet. I've achieved this by copying the orinal OEM sheet, so we have OEM and OEM(1). All good so far, except of course the VBA code does not work for the new sheet "OEM(1)"

I hope that's explained clearly enough. So my question is, what is the best way to get around this i.e. get some VBA code to run on OEM(1)? I realise I could create more code for potential new sheets but am hoping there is a more elegant way?

Any help gratefully received.

Steve
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Worksheets dilemma

Superb! Thanks again Claus. I've adapted it a bit and it's doing exactly what I want. I was stumped for a long time until I realised the line Cancel = True was cancelling things and not allowing it to go on and do the save.

Cheers!

Steve
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
What if Dilemma Gareth[_2_] Excel Discussion (Misc queries) 2 September 25th 08 04:37 PM
BIG Dilemma.....HELP!! Amber Excel Worksheet Functions 5 May 30th 07 01:26 AM
If Then Dilemma Excel Confused Excel Worksheet Functions 21 December 29th 06 12:11 AM
Nth power dilemma Andre Croteau Excel Discussion (Misc queries) 6 June 23rd 06 09:16 PM
XL add-in dilemma brio Excel Programming 1 February 17th 04 09:13 PM


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