LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Calling my macro is only working if certain options are selected

Hi there I have attached at the bottom a piece of code from a
questionnaire I have made (with lots of help) and it calls a macro
called addNewSheet at the end - for some reason this only works if
they select yes for the final bit and if they select no nothing
happens. Would anyone know where I am going wrong?


detri = MsgBox("Question 4e. Could this information have had a
detrimental effect on KM if it fell into the wrong hands?", vbYesNo)
If detri = vbYes Then
Range("D18") = "Question 4e. Could this information have had a
detrimental effect on KM if it fell into the wrong hands?"
Range("E18") = "Yes"
Range("E18").Font.ColorIndex = 5
WhyDetri = InputBox("Question 4f. Why?")
Range("D19") = "Question 4f. Why?"
Range("E19") = WhyDetri
Range("E19").Font.ColorIndex = 5
Columns("E").AutoFit
Range("D13:E19").BorderAround ColorIndex:=xlAutomatic,
Weight:=xlMedium
Range("D13:E19").Borders(xlInsideHorizontal).LineS tyle =
xlContinuous
Range("D13:E19").Borders(xlInsideVertical).LineSty le =
xlContinuous
Else
Range("D18") = "Question 4e. Could this information have had a
detrimental effect on KM if it fell into the wrong hands?"
Range("E18") = "No"
Range("E18").Font.ColorIndex = 5
Columns("E").AutoFit
Range("D13:E18").BorderAround ColorIndex:=xlAutomatic,
Weight:=xlMedium
Range("D13:E18").Borders(xlInsideHorizontal).LineS tyle =
xlContinuous
Range("D13:E18").Borders(xlInsideVertical).LineSty le =
xlContinuous

End If

Call addNewSheet

End Sub

 
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
Protect selected settings in 'options' John Excel Worksheet Functions 4 June 15th 09 07:48 AM
how do I display list options as different colour when selected? MarilynP Excel Worksheet Functions 2 March 8th 07 10:06 PM
Working with options from within Tools Options clears the Clipboar Peter Rooney Excel Programming 6 November 18th 05 04:49 PM
Calling in data from a selected cell Alan[_31_] Excel Programming 1 August 4th 05 05:41 PM
Calling another workbook not working malik641 Excel Worksheet Functions 2 June 24th 05 07:36 PM


All times are GMT +1. The time now is 12:27 AM.

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"