Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 13th, 2006, 09:49 AM
Registered User
 
Join Date: Sep 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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.






Similar Threads
Thread Thread Starter Forum Replies Last Post
access function in data sheet(another sheet) jani Excel VBA 1 May 21st, 2008 07:15 PM
Add existing AD user to AD group via ADSI? thiazi Classic ASP Basics 0 August 24th, 2007 09:27 PM
Insert Record & retrieve ID gundulf ADO.NET 5 July 12th, 2007 10:03 PM
Insert Excel sheet content into Access table from stepdev Access VBA 2 December 8th, 2006 04:18 PM
How to insert and retrieve image? hlchuah77 SQL Server 2000 3 February 13th, 2005 11:41 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.