View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
[email protected] Pasty_The_First@hotmail.com is offline
external usenet poster
 
Posts: 5
Default Calling my macro is only working if certain options are selected

On 29 Mar, 17:36, "John Coleman" wrote:
Hi

(code snipped)

addNewSub() should work the same no matter what button you clicked on
the message box - you make a copy of the current sheet, rename it,
clear and relabel as sheet 1 the original then hide the copy. (no?)
What do you mean when you say "it does nothing?" For debugging
purposes maybe comment out the lines

ActiveSheet.Visible = xlVeryHidden
ActiveWorkbook.Save

and run it. At the end of the run - just what (in the case you
selected no) is wrong with the active sheet? Was a copy in fact made?



Hi there I have worked it out - its because I put in an exit sub at
the end of this bit

Else
Range("D13") = Msg3
Range("E13") = "No"
Range("E13").Font.ColorIndex = 5
Columns("E").AutoFit
Range("D13:E13").BorderAround ColorIndex:=xlAutomatic,
Weight:=xlMedium
Range("D13:E13").Borders(xlInsideVertical).LineSty le =
xlContinuous
Exit Sub

I have put in the Call addNewSheet bit in just before the exit sub and
this works now.

Thanks a lot for you all your help.

Regards

Matt