Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Run code only when a sheet has not been changed

Hi All,

Easy question (I hope). I have some code that sets the values of a bunch of
combo boxes, set to fire on Worksheet_Open. Obviously, this causes a
problem, as users will edit the form, save it , and then re-open the form to
find that the data they have input in the combo boxes is gone. I presume the
best way to prevent this is to only run the code that sets the values when
the sheet is clean/virgin/whatever you want to call it. Is there a way to do
that, or is there a better way?

TIA,
Harry
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Run code only when a sheet has not been changed

I guess I am having a hard time understanding why it would be a problem if
the user's input in no longer as they left it, when the program is designed
to do something with the data after it is entered. Should they not expect
their data to be moved, calculated or manipulated in some form? Is it a
program design flaw? If not, Just have a pop up text message that tells them
when they open the file that their data will be manipulated and they need not
expect to see it in the form that they enter it.

"Harry F." wrote:

Hi All,

Easy question (I hope). I have some code that sets the values of a bunch of
combo boxes, set to fire on Worksheet_Open. Obviously, this causes a
problem, as users will edit the form, save it , and then re-open the form to
find that the data they have input in the combo boxes is gone. I presume the
best way to prevent this is to only run the code that sets the values when
the sheet is clean/virgin/whatever you want to call it. Is there a way to do
that, or is there a better way?

TIA,
Harry

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Run code only when a sheet has not been changed

The code that presently runs on open sets the selectable ranges - I guess I
should have clarified that. For instance:

With Sheet2.ComboBox1
.ListFillRange = "REF!A1:A5"
.ListIndex = 0
End With

The user would then select a value from the box, save the sheet, and perhaps
want to change it later before submitting. However when he/she re-enters the
sheet, it overwrites the selection to reset the list index. I need the list
index to reset to 0 everytime a new sheet is opened, though.

"JLGWhiz" wrote:

I guess I am having a hard time understanding why it would be a problem if
the user's input in no longer as they left it, when the program is designed
to do something with the data after it is entered. Should they not expect
their data to be moved, calculated or manipulated in some form? Is it a
program design flaw? If not, Just have a pop up text message that tells them
when they open the file that their data will be manipulated and they need not
expect to see it in the form that they enter it.

"Harry F." wrote:

Hi All,

Easy question (I hope). I have some code that sets the values of a bunch of
combo boxes, set to fire on Worksheet_Open. Obviously, this causes a
problem, as users will edit the form, save it , and then re-open the form to
find that the data they have input in the combo boxes is gone. I presume the
best way to prevent this is to only run the code that sets the values when
the sheet is clean/virgin/whatever you want to call it. Is there a way to do
that, or is there a better way?

TIA,
Harry

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Run code only when a sheet has not been changed

It still comes down to, the user is going to revise their input anyhow. So I
don't see why it matters that their original input is no longer there. Their
second input would override the firsts anyhow, wouldn't it? Or am I all
screwed up in my logic?

"Harry F." wrote:

The code that presently runs on open sets the selectable ranges - I guess I
should have clarified that. For instance:

With Sheet2.ComboBox1
.ListFillRange = "REF!A1:A5"
.ListIndex = 0
End With

The user would then select a value from the box, save the sheet, and perhaps
want to change it later before submitting. However when he/she re-enters the
sheet, it overwrites the selection to reset the list index. I need the list
index to reset to 0 everytime a new sheet is opened, though.

"JLGWhiz" wrote:

I guess I am having a hard time understanding why it would be a problem if
the user's input in no longer as they left it, when the program is designed
to do something with the data after it is entered. Should they not expect
their data to be moved, calculated or manipulated in some form? Is it a
program design flaw? If not, Just have a pop up text message that tells them
when they open the file that their data will be manipulated and they need not
expect to see it in the form that they enter it.

"Harry F." wrote:

Hi All,

Easy question (I hope). I have some code that sets the values of a bunch of
combo boxes, set to fire on Worksheet_Open. Obviously, this causes a
problem, as users will edit the form, save it , and then re-open the form to
find that the data they have input in the combo boxes is gone. I presume the
best way to prevent this is to only run the code that sets the values when
the sheet is clean/virgin/whatever you want to call it. Is there a way to do
that, or is there a better way?

TIA,
Harry

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Run code only when a sheet has not been changed

They would not want to change the inputs they have already made, only those
that havent been made.

For instance, if there's 10 combo boxes, and 10 free text cells, the user
would input 5 combo boxes and 8 cells. He would save the sheet, then perhaps
get the remainder of the information he needed to complete the form (fill the
remaining 5 combo boxes and 2 cells). When he opens the sheet, the 5 combo
boxes he's filled out have been overwritten.

"JLGWhiz" wrote:

It still comes down to, the user is going to revise their input anyhow. So I
don't see why it matters that their original input is no longer there. Their
second input would override the firsts anyhow, wouldn't it? Or am I all
screwed up in my logic?

"Harry F." wrote:

The code that presently runs on open sets the selectable ranges - I guess I
should have clarified that. For instance:

With Sheet2.ComboBox1
.ListFillRange = "REF!A1:A5"
.ListIndex = 0
End With

The user would then select a value from the box, save the sheet, and perhaps
want to change it later before submitting. However when he/she re-enters the
sheet, it overwrites the selection to reset the list index. I need the list
index to reset to 0 everytime a new sheet is opened, though.

"JLGWhiz" wrote:

I guess I am having a hard time understanding why it would be a problem if
the user's input in no longer as they left it, when the program is designed
to do something with the data after it is entered. Should they not expect
their data to be moved, calculated or manipulated in some form? Is it a
program design flaw? If not, Just have a pop up text message that tells them
when they open the file that their data will be manipulated and they need not
expect to see it in the form that they enter it.

"Harry F." wrote:

Hi All,

Easy question (I hope). I have some code that sets the values of a bunch of
combo boxes, set to fire on Worksheet_Open. Obviously, this causes a
problem, as users will edit the form, save it , and then re-open the form to
find that the data they have input in the combo boxes is gone. I presume the
best way to prevent this is to only run the code that sets the values when
the sheet is clean/virgin/whatever you want to call it. Is there a way to do
that, or is there a better way?

TIA,
Harry

Reply
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
do some code after the sheet name is changed ARHangel Excel Discussion (Misc queries) 1 January 18th 08 10:39 AM
Code to list users that have changed a spreadsheet Jo Excel Programming 1 June 22nd 05 12:57 PM
How can this code be changed Greg B Excel Discussion (Misc queries) 3 May 18th 05 04:32 PM
option buttons run Click code when value is changed via VBA code neonangel Excel Programming 5 July 27th 04 08:32 AM
Code - if T changed, change date in W to date it is changed Sandy[_3_] Excel Programming 2 July 27th 03 05:33 PM


All times are GMT +1. The time now is 07:53 AM.

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"