LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 81
Default Change worksheet, two trigger cells on one worksheet, only one triggers correctly; using two If statements, do I need End If?

Thanks, it took me awhile to notice that you changed the If to If Not. Once
I saw that, it works perfectly! Thanks very much, Harold


"jasontferrell" wrote in message
...
The process needs to check both conditions before exiting the
subroutine. I think you can just change the initial "exit" check to
only process if the if is "true", as follows.


Private Sub Worksheet_Change(ByVal Target As Range)
'Budget
Set t = Target
Dim symbbud As String
symbbud = Range("CurrencySymbolBudget").Value
On Error GoTo ErrHandler:
If Not Intersect(t, Range("B4")) Is Nothing Then
'ActiveSheet.Unprotect Password:=" "

Select Case Range("B4").Value
Case "$"
'this line does not use any spaces to separate the $ symbol from
the number
Range("BudgOtherCurrencyCells").NumberFormat = symbbud &
"#,##0;[red]" & symbbud & "-#,##0;0"
Case Else
'this line uses one space to separate the currency symbol from the
number
Range("BudgOtherCurrencyCells").NumberFormat = symbbud & "
#,##0;__[red]" & symbbud & "__-#,##0;0"
End Select
End If
If Not Intersect(t, Range("E173")) Is Nothing Then

Select Case Range("E173").Value
Case "3"
Range("H2:U4").UnMerge
Columns("L:M").Select
Selection.EntireColumn.Hidden = True
Range("H2:U4").Merge
End Select
End If
'ActiveSheet.Protect Password:=""

Exit Sub
ErrHandler:
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
Run VBA code only worksheet change, but don't trigger worksheet_change event based on what the code does ker_01 Excel Programming 6 October 3rd 08 09:45 PM
trigger worksheet activate event in another worksheet Raj[_2_] Excel Programming 2 June 2nd 08 01:09 PM
Cell value change to trigger macro (worksheet change event?) Neil Goldwasser Excel Programming 4 January 10th 06 01:55 PM
Copying Worksheet triggers Click event of combobox Copying Worksheet triggers click event on combobox Excel Programming 2 January 25th 04 10:51 PM
Copying Worksheet triggers Click event of combobox on another worksheet Robert[_20_] Excel Programming 0 January 23rd 04 07:40 PM


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