Hi All
I need a kind of ‘Conditional Save and Copy’ routine for my project. It’s hard to explain briefly without attaching reams of code or the workbook itself, but I’ll try.
Pseudo code working so far:
What I need is for the “Copy and add this line to Sheet2” line 2nd from end to only happen if 2 or 3 critical Text Boxes have been changed
These critical boxes contain time and date values, which are cumulatively summed on Sheet2. So I don’t want to add another lot of times, if the User only looked at the existing record without changing any of the critical values
I’m working on (a) setting a “CopyRecord” flag if the time value boxes are changed, or (b) Stepping through the highlighted row, and setting the flag if the Form data is different from Sheet1.
Which (if either!) of these is the quickest/slickest = Best way?
Or is there a super-simple method I’m missing?
Thanks in advance for any and all hints or guidance.![[thumbsup2] [thumbsup2] [thumbsup2]](/data/assets/smilies/thumbsup2.gif)
Chris
Varium et mutabile semper Excel
I need a kind of ‘Conditional Save and Copy’ routine for my project. It’s hard to explain briefly without attaching reams of code or the workbook itself, but I’ll try.
Pseudo code working so far:
Code:
Pseudo Sub DataEntry()
Show a Form
User selects/types value in ComboBox and rest of form controls
OK button clicked
If ComboBox .Value doesn’t exist in Sheet1, Col A then
Add a new line with all the data
Copy and add the new line to Sheet2
Sort Sheet1 by Col A
Clear the Form and start again
Else
Highlight matching row on Sheet1 and load form with row values
User reads/edits data in form
OK button clicked
Update highlighted row with data from form
Copy and add this line to Sheet2 '<= Do this conditionally
Clear the Form and start again
End Sub
These critical boxes contain time and date values, which are cumulatively summed on Sheet2. So I don’t want to add another lot of times, if the User only looked at the existing record without changing any of the critical values
I’m working on (a) setting a “CopyRecord” flag if the time value boxes are changed, or (b) Stepping through the highlighted row, and setting the flag if the Form data is different from Sheet1.
Which (if either!) of these is the quickest/slickest = Best way?
Or is there a super-simple method I’m missing?
Thanks in advance for any and all hints or guidance.
![[thumbsup2] [thumbsup2] [thumbsup2]](/data/assets/smilies/thumbsup2.gif)
Chris
Varium et mutabile semper Excel