Option Explicit ' ------------------------------------------------------------------------- ' From the book Inside Active Directory, ISBN 0-201-61621-1 ' Copyright (C) 2002 by Addison-Wesley ' Script by Sakari Kouti (see http://www.kouti.com) ' You have a royalty-free right to use, modify, reproduce and distribute ' this script (and/or any modified version) in any way you find useful, ' provided that you agree that Addison-Wesley or Sakari Kouti has no ' warranty, obligations or liability for the script. If you modify ' the script, you must retain this copyright notice. ' ------------------------------------------------------------------------- Function BrowseUsers() Dim strFirstName, strLastName ActiveSheet.Range("A2").Activate Do strFirstName = ActiveCell.Value strLastName = ActiveCell.Offset(0, 1).Value Call CreateUser(strFirstName, strLastName) ActiveCell.Offset(1, 0).Activate Loop While ActiveCell.Value <> "" End Function Sub CreateUser(strFirstName, strLastName) 'add lines to create a user here 'you can use the following line to test this MsgBox (strFirstName & " " & strLastName) End Sub