Hi
Im not 100% sure about XP but there should be a workbook_open sub on the workbook code or something similar. Put the code there.
HTH
Jacob
There are a lot of ways to do this.
This is one way put this in the sheet code page.
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
If Not Intersect(Target, Selection) Is Nothing Then
If Target.Interior.ColorIndex = 34 Then
Target.Interior.ColorIndex = 0
Else
Target.Interior.ColorIndex = 34
End If
End If
End Sub
Every time you start the workbook and select a cell it will change colors, select it again and it will change back to its original color. It works by events. There are a lot of events to pick from!
Private Sub App_WorkbookOpen(ByVal Wb As Workbook)
Application.Windows.Arrange xlArrangeStyleTiled
End Sub
On a workbook open this will re-arrange the windows by title.
On older systems you can build a DOS batch file to open Excel with a default workbook and start a macro by adding the name of the macro behind the start name for Excel, but this is not done now and you must auto-run your code with an event.
You could check out the "Shell" code it lets you, start something like the windows calculator in a window on top of your default workbook, every time you start Excel? JSW
thanks Joe,
It seems that I am missing something here. It did not work for me at all. Should I define a special name for the module in which I write the private sub? Should I define an "environment" symbol or definition?
Doron.
Found it!!! sub workbook_open worked for me.
thnx!
doron :) .
It just go's in Sheet1 and it should work, it works for me?