Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
ive been given instructions to create a macro which will be used on a form to add a new user to a system. Could somebody please help me with writing out this code? the steps are below, thank you to anybody who helps me with this
Create a macro that will add the username and password to the UserDetails worksheet. You will need to include code for the following stages: * Declare the variables that you need. (Row, RowNum, NumUsers as Integer and Cellref, Cellref2, pword and uname as String) * Assign values to the NumUser, pword and uname variables from the named ranges on the worksheet. * Store the value 1 in the RowNum variable. * Move to the UserDetails worksheet. * Start a For Next loop that loops from 1 to NumUsers. (For Row = 1 to NumUsers) * Generate the cell references for username and password and store these in variables. (you need two) * Use an If statement to enter the password and username into the first available row, move back to the log in form and display a confirmation message if the cell is empty and and adds 1 to the Row Number if it is not empty. * Loops to next row. (Next Row) |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Sum-macro or code | Excel Discussion (Misc queries) | |||
Please Help with Macro Code | Excel Discussion (Misc queries) | |||
Macro code | Excel Discussion (Misc queries) | |||
Deleting code from a macro (by a macro) | Excel Discussion (Misc queries) | |||
Macro code | Excel Discussion (Misc queries) |