Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 4
Unhappy vba/macro code

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)
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sum-macro or code puiuluipui Excel Discussion (Misc queries) 1 October 17th 09 03:10 PM
Please Help with Macro Code Damil4real Excel Discussion (Misc queries) 1 August 12th 09 07:09 PM
Macro code Shu of AZ Excel Discussion (Misc queries) 8 December 2nd 07 12:52 AM
Deleting code from a macro (by a macro) Brettjg Excel Discussion (Misc queries) 2 May 8th 07 10:14 PM
Macro code Shu of AZ Excel Discussion (Misc queries) 2 January 29th 07 06:29 PM


All times are GMT +1. The time now is 11:57 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"