TitusandNero
New Member
- Joined
- Mar 17, 2016
- Messages
- 26
Hi again, (operating on Excel 2007)
You guys have been terrific but I come to you yet again with another glitch in my database. I started as a newbie and from learning on here and watching youtube vids. I've managed to create a multipage userform that populates an excel sheet re-named 'Data'. For the end product I'd eventually like to hide this Data sheet from the end user (prevent tampering) and there to be a front sheet so when you open Excel there's a picture, and an open/show 'userform' button etc. I can create the front sheet but here is the problem. Once I've created the front sheet the number generator on my userform defaults to it and is no longer linked to the Data sheet. So it consistently generates #1 and not the actual next sequential number on the Data sheet. I'm guessing I need the generator to focus? The number generator is a command button (cmdGNCN) which populates a textbox (tbGNCN1). The column in the Data sheet where the number is saved/sourced is column A. Can anybody help? Here is my coding for the number generator.
Private Sub cmdGNCN_click()
Me.tbGNCN1 = Application.WorksheetFunction.Max(Range("A:A")) +1
End Sub
You guys have been terrific but I come to you yet again with another glitch in my database. I started as a newbie and from learning on here and watching youtube vids. I've managed to create a multipage userform that populates an excel sheet re-named 'Data'. For the end product I'd eventually like to hide this Data sheet from the end user (prevent tampering) and there to be a front sheet so when you open Excel there's a picture, and an open/show 'userform' button etc. I can create the front sheet but here is the problem. Once I've created the front sheet the number generator on my userform defaults to it and is no longer linked to the Data sheet. So it consistently generates #1 and not the actual next sequential number on the Data sheet. I'm guessing I need the generator to focus? The number generator is a command button (cmdGNCN) which populates a textbox (tbGNCN1). The column in the Data sheet where the number is saved/sourced is column A. Can anybody help? Here is my coding for the number generator.
Private Sub cmdGNCN_click()
Me.tbGNCN1 = Application.WorksheetFunction.Max(Range("A:A")) +1
End Sub