LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Mr. G.
 
Posts: n/a
Default Linking worksheet event codes

The (row shading) worksheet event code furnished by B.Phillips was exactly
what I've been looking for. However, since I have already have a worksheet
event code running (developed by Julie D) when the user opens up the
spreadsheet, does anyone know if it's possible to still incorporate/link his
code with mine?

(Mr. Phillips)
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'----------------------------------------------------------------
Cells.FormatConditions.Delete
With Target.EntireRow
.FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
With .FormatConditions(1)
With .Borders(xlTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 2
End With
With .Borders(xlBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 2
End With
End With
.FormatConditions(1).Interior.ColorIndex = 20
End With

(Mine)
Private Sub Worksheet_Change(ByVal Target As Range)

If Not Intersect(Target, Me.Range("F12:F15")) Is Nothing Then '1"
On Error Resume Next
Application.ScreenUpdating = False
Application.Calculation = xlCalculationAutomatic
For Each c In Range("F13:F15")
If c.Value = "" And c.Offset(0, 46) = 0 Then
Sheets("EXP RPT").Unprotect ("lindAP")
c.EntireRow.Hidden = True
i = c.Row
Sheets("EXP RPT").Protect ("lindAP")
End If
Next
For Each c In Range("F12:F15")
If c.Value < "" Then
Sheets("EXP RPT").Unprotect ("lindAP")
c.Offset(1, 0).EntireRow.Hidden = False
i = c.Row
Sheets("EXP RPT").Protect ("lindAP")
End If
Next
ElseIf Not Intersect(Target, Me.Range("F17:F20")) Is Nothing Then '1"
On Error Resume Next
Application.ScreenUpdating = False
Application.Calculation = xlCalculationAutomatic
For Each c In Range("F18:F20")
If c.Value = "" And c.Offset(0, 46) = 0 Then
Sheets("EXP RPT").Unprotect ("lindAP")
c.EntireRow.Hidden = True
i = c.Row
Sheets("EXP RPT").Protect ("lindAP")
End If
Next
For Each c In Range("F17:F20")
If c.Value < "" Then
Sheets("EXP RPT").Unprotect ("lindAP")
c.Offset(1, 0).EntireRow.Hidden = False
i = c.Row
Sheets("EXP RPT").Protect ("lindAP")
End If
Next
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
End If
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
Excel worksheet linking Shiren Excel Worksheet Functions 0 July 6th 05 05:33 PM
Linking cells in a worksheet to other worksheets in a workbook Dave Excel Discussion (Misc queries) 4 June 24th 05 06:18 PM
Worksheet linking Bed Excel Worksheet Functions 1 April 29th 05 03:08 AM
Worksheet Row Change event crazybass2 Excel Discussion (Misc queries) 4 December 8th 04 05:29 PM
Linking items GREATER THAN O on another worksheet in the same Work Eddie Shapiro Excel Discussion (Misc queries) 4 December 1st 04 02:55 PM


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