Retrieve data from AD and insert into sheet
Hi,
I'm not an expert in excel VBA, therefore my question:
I need to query the number of accounts in the AD and put this number in an excel sheet using VBA.
I do already have the AD query. The variable sNbrTotal stores the number of AD accounts retrieved from the AD.
The number should only be put in a cell corresponding with the current month (month of executing the script obtained from system date) in the worksheet ADAccounts (contains column headings "mon/jjjj" "Number") when the values for that month are still zero in the sheet (by default cells are filled with zero). If the total number of accounts for that month are not zero in the sheet, the data should not be updated, since this means that the script has filled the cells for that month already.
Who can help me how to implement this?
format "ADAccounts" sheet:
Month Number
jan/2006 0
feb/2006 0
...
If script is ran in September/2006 for the first time, the value of sep/2006 should be updated. If the script has already ran during september 2006, the value for sep/2006 should remain.
|