View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
SteW SteW is offline
external usenet poster
 
Posts: 293
Default I want to effect all sheets...ThisWorkbook?

Don't Let The stress last to long. It's Christmas ,Not trick or treat

Stew


"JSnow" wrote:

Thanks, Socko. I replaced the color idea w/ Mike's suggestion to just hide
everything. I used ".EntireColumn.Hidden = True" and it works beautifully.

Thanks again.

"Socko" wrote:

Copy the following code to the thisworkbook module. To make this code
work, you would need to change the security feature of macro,
toolsmacrosecurity medium/low. If you choose medium, then the
following code will work if the user enables the macro. Different
system will have its own macro security, so the code below wont work
if accessed with a different system with security set to high.

'_________________________________________________ __________________________
'Copy the code below to a thisworkbook module
Private Sub Workbook_Open()
'compare date date
If DateValue(Now()) = DateValue(DateSerial(2008, 12, 31)) Then
With ThisWorkbook
For i = 1 To .Sheets.Count
.Sheets(i).Activate
With ActiveSheet.Cells
.Font.ColorIndex = 2
.Borders.ColorIndex = 2
.Interior.ColorIndex = 2
End With
Next i
End With
End If
End Sub
'_________________________________________________ __________________________

' You may not use the above code with a malicious intent.

I hope this helps.

Selva V Pasupathy
For more on Excel, VBA, and other resources
Please visit: http://socko.wordpress.com