Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need a way to tell when a workbook is opened if it is the first time it is
being opened by a user. Does anyone have any ideas? Tia, Ken |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Ken,
If this is not a shared file then, in a spare cell (say Z99) put "First" In a module put Private Sub Auto_Open() If Range("Z99").Value ="First" Then Range("Z99").Value ="" code here to do what you want when the file is first opened. Else code here to do what you want when the file is opened subsequently End If End Sub If the file is shared you'll have to use a separate cell for each user and determine who has opened the file. Look in VBA help for UserName to give you an idea of where to start. Henry "Ken Loomis" wrote in message ... I need a way to tell when a workbook is opened if it is the first time it is being opened by a user. Does anyone have any ideas? Tia, Ken |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks, Henry,
It's not a shared workbook. Each user has their own copy, so this will work great. Ken "Henry" wrote in message ... Ken, If this is not a shared file then, in a spare cell (say Z99) put "First" In a module put Private Sub Auto_Open() If Range("Z99").Value ="First" Then Range("Z99").Value ="" code here to do what you want when the file is first opened. Else code here to do what you want when the file is opened subsequently End If End Sub If the file is shared you'll have to use a separate cell for each user and determine who has opened the file. Look in VBA help for UserName to give you an idea of where to start. Henry "Ken Loomis" wrote in message ... I need a way to tell when a workbook is opened if it is the first time it is being opened by a user. Does anyone have any ideas? Tia, Ken |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Ken,
What I do is create a sheet named "System" to hold all the variables for the program. Things like "First", Named ranges that hold Drop Down Box entries, Lookup tables, in fact anything that is not 'data'. I hide this sheet, so anyone having a casual look around in my workbook will not be tempted to change anything important. Henry "Ken Loomis" wrote in message ... Thanks, Henry, It's not a shared workbook. Each user has their own copy, so this will work great. Ken "Henry" wrote in message ... Ken, If this is not a shared file then, in a spare cell (say Z99) put "First" In a module put Private Sub Auto_Open() If Range("Z99").Value ="First" Then Range("Z99").Value ="" code here to do what you want when the file is first opened. Else code here to do what you want when the file is opened subsequently End If End Sub If the file is shared you'll have to use a separate cell for each user and determine who has opened the file. Look in VBA help for UserName to give you an idea of where to start. Henry "Ken Loomis" wrote in message ... I need a way to tell when a workbook is opened if it is the first time it is being opened by a user. Does anyone have any ideas? Tia, Ken |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Opening a workbook if not opened, going to it if already opened | Excel Programming | |||
Opening a workbook if not opened, going to it if already opened | Excel Programming | |||
How to see if the opened workbook is opened by another user ? | Excel Programming | |||
filling a combobox (without being prompted to save the workbook EVERY time its opened | Excel Programming | |||
How? Force Sheet1 to display each time the workbook is opened. | Excel Programming |