Академический Документы
Профессиональный Документы
Культура Документы
data. Earlier we had demonstrated how create and manage databases in Excel with
user forms. But many people were not able to implement the concept. Most notably
many found the concept of global variables difficult to use and many just forgot to
declare the global variable at the top of the VBA code. Once you understand the
global variable and how to use the correct sequence in VBA coding of the �back� and
�next� navigation buttons, you�ll be able to create other buttons like �update� and
�clear data�. This will make the managing of databases in Excel with user-forms
easier.
Here�s the complete VBA code to create user-forms with navigation buttons:
Dim currentrow As Long � declare the global variable right at the top
End Sub
currentrow = currentrow + 1
TextBox1 = Cells(currentrow, 1)
TextBox2 = Cells(currentrow, 2)
TextBox3 = Cells(currentrow, 3)
End Sub
currentrow = currentrow � 1
TextBox1 = Cells(currentrow, 1)
TextBox2 = Cells(currentrow, 2)
TextBox3 = Cells(currentrow, 3)
End Sub