Hi all
I’ve got a very interesting little problem (or not as the case may be).
I’ve been developing some very simple tools for my company in the form of some standard spreadsheets. We have recently switched over from Office 2003 to 2007. Below is an extract of code from the spreadsheet that doesn’t seem to do anything anymore. Now for the really interesting bit, when I copy the sheet into a new workbook, the code works perfectly until the document is saved at which point it reverts to being “broken”.
Any help would be very much appreciated
I’ve got a very interesting little problem (or not as the case may be).
I’ve been developing some very simple tools for my company in the form of some standard spreadsheets. We have recently switched over from Office 2003 to 2007. Below is an extract of code from the spreadsheet that doesn’t seem to do anything anymore. Now for the really interesting bit, when I copy the sheet into a new workbook, the code works perfectly until the document is saved at which point it reverts to being “broken”.
Code:
Set myrange = ActiveCell
Application.ScreenUpdating = False
Select Case Target.Address
Case "$D$10"
If ActiveCell = "Vapour" Then
Range("D17:D18").Select
Selection.Interior.ColorIndex = 35
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
Range("D19:D21").Select
Selection.Interior.ColorIndex = xlNone
With Selection.Borders(xlDiagonalDown)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlDiagonalUp)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Else
Range("D19:D21").Select
Selection.Interior.ColorIndex = 35
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
Range("D17:D18").Select
Selection.Interior.ColorIndex = xlNone
With Selection.Borders(xlDiagonalDown)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlDiagonalUp)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
End If
****REST OF CODE MISSING****
Any help would be very much appreciated