Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple data from excel problem

Status
Not open for further replies.

jmb2000

Technical User
Feb 11, 2004
11
AU
Hi guys sorry if this has been asked before (I have searched forum but could not find quite what I'm after) but I have a script to search AD at the moment and return usernames that are input with OU they are in etc. however I would like to get the list of usernames from an excel spreadsheet so I can do a few hundred at a time. Can anyone help me out with the code to use the entries in one column (say column 3 for arguments sake) and go down the list searching for each name in order? I already have the script outputting to a text file etc. it is purely the input from excel and repeat on next row I can't seem to get right.

Thanks

John
 
Try a keyword search in this forum for excel read (31 hits at the moment)

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Thanks PHV but I have already gone through just searching for Excel (just retried with excel read to make sure) but with one exception that tells how to adds entries to a new excel sheet there doesn't seem to be anything there. I've only been scripting for a couple of weeks so am still picking it up and am not sure if I can make the correct alterations to just set a column of data to variables.
 
Something like this (provided xlApp is your instantation of the Excel.Application object, the workbook is opened and the sheet is the active one) ?
For Each c in xlApp.Cells("C:C")
MsgBox "UserName=" & c.Value
Next

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
I think I must be doing something stupid as it's not working but thanks anyway, I'll go back to the books again and try to figure it out.

Cheers

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top