Okay - that's more like it! Wonderful! Thank you! The only issue I have yet, is that a user can change the values in those cells without being notified about it... could that be worked in there somehow?
So what do you think?![]()
Another addition to the Change Event - this goes above the last snippet:
Code:If Not intersect(Target, Range("B9:G9,B11:C11")) Is Nothing Then MsgBox "Do not change the part number or revision number. Save the file as the relevant name and the numbers will change automatically." On Error Resume Next With Application .EnableEvents = False .Undo .EnableEvents = True End With Exit Sub End If
So long, and thanks for all the fish.
Wow! That works! Almost...
When I save the blank as a part number and rev, then add additional data to the workbook, upon closing it I get the window that asks if I want to save the changes. I click yes. Then it asks me again. So I click yes. Haha, I could go on for a long time...![]()
Can you post the current version?
So long, and thanks for all the fish.
Absolutely! Here is what we have so far... Thanks again for all your time!
Add this to the ThisWorkbook module:
Code:Private Sub Workbook_BeforeClose(Cancel As Boolean) Dim lngResp As Long If Not ThisWorkbook.Saved Then ThisWorkbook.Saved = True lngResp = MsgBox("Do you wish to save the workbook before closing?", vbYesNo) If lngResp = vbYes Then ThisWorkbook.Save End If End If End Sub
So long, and thanks for all the fish.
Hmm.. now when I close the workbook after making changes, I first get your window asking 'Do you wish to save the workbook before closing?' and I say yes, then I get the default one asking me the same thing, and I can still click Yes a hundred times in a row without it closing!
That's odd - it was working in my tests. I won't be able to look at it until next week now, I'm afraid.
So long, and thanks for all the fish.
That's okay, I'll wait! Maybe you should reattach the workbook that was working for you - in case I'm doing something wrong...
Unfortunately, it's at work and I'm on my way home...
So long, and thanks for all the fish.
Okay, well don't worry about it.. it's not that urgent, thanks again! And have a great weekend!![]()
I seem to have somehow missed a bit when posting. It should be:
Code:Private Sub Workbook_BeforeClose(Cancel As Boolean) Dim lngResp As Long If Not ThisWorkbook.Saved Then ThisWorkbook.Saved = True lngResp = MsgBox("Do you wish to save the workbook before closing?", vbYesNo) If lngResp = vbYes Then With ThisWorkbook .Save .Saved = True End With End If End If End Sub
So long, and thanks for all the fish.
Hello! Hey, thanks so much for that!It seems to work well!
I do have a few more questions, nothing really important, just little adjustments we could do...
I tried to find the code where it selects the digits before the REV, so I could remove that space it puts in there after the number, but I couldn't find it! Also, if either of the two cells are clicked in and not modified, the user still gets an error message saying not to change it - I would be nicer if the error would only appear if the value was actually changed.
Again, only trifles - but I thought I'd ask.And thanks again!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks