vba courses london - counters excel
Microsoft Office Training verified by visa - mastercard securecode about microsoft training company london ukadd this page to your favourites/bookmarksAdd to favourites
view a printable version of this pagePrintable version
email this page to somebodyEmail this page
Customer: Sign in
Delegate: Sign in
Trainer: Log in

Forum home » Delegate support and help forum » Microsoft VBA Training and help » vba courses london - Counters in excel

vba courses london - Counters in excel

The UK's most regular instructor-led training courses.
Training information: vba courses london · Excel london

resolvedResolved · Low Priority · Version Standard

Counters in excel

Ricci has attended:
Excel VBA course

by - delegate Ricci [1 post] (2007 Jan 24 Wed, 17:26) replyReply

I have some data that I'm trying to produce a report from, I have a huge list of employee names that are duplicated and are in no order. I want 1 list of employees in alphabetical order with no repitions to use in a drop down list on a form. I remembered in my training the mention of counters, but I can't remember how to use them or how to incorporate this with a form.

Cheers,
Ricci

RE: Counters in excel

by - trainer Carlos gold contributer[479 posts] (2007 Jan 26 Fri, 11:00) replyReply

To create a list if employees with no duplicates do the following:

Record a macro to Select the Name column and sort it

Create a sheet for the new records "New Sheet"

Create a OldRow counter and set it to the first row of the names

Create a NewRow counter and set it to the row of the "New Sheet" where the records are going

On the Daata Sheet if the Names aree in Column 1 do the following:

Do a For counter loop taking into account the number of rows in the data

Cells(OldRow,1).Select

Copy it to the new sheet

Move New row down One

Add the value of the cell to a variable

move OldRow down one

Check if the value of Cell(OldRow,1) equals the Variable

If it does Move down One row

Else

repeat the copy routine and add the new name to the variable

With the above routine in mind You can look at the code On the disk in the manual and adapt the code in CopySalesRecords and the little routione to check for duplicate dates






Related articles

· Should You Send Managers To VBA Training?
· Visual Basic Returns To The Macintosh
· What Is Microsoft Excel VBA and How Can It Help You Work Smarter?
· How To Find A Good VB For Access Trainer
· Company Roles in Visual Basic Training

Vba tip:

Good coding practice

It is important that you always comment the VBA code that you write. By doing this it will make the code much easier to read, as both yourself and other people will be able to see what the code is doing or meant to be doing. This is very important if there is more than one person who writes code in the company as you may have different styles of coding and may not really understand what the other person is trying to do. Also if you write some code and then do not touch it for a year or so you may actually forget what it is meant to be doing. so it is very important to include comments throughout your code and try and make sure that they are as useful as possible

View all VBA hints and tips

Rate this page:
4.0/5 (3 votes cast)
Institute of IT Training - Accredited Training Provider Microsoft Certified Partner
microsoft office
Microsoft Office Specialist Authorised Testing Centre (MOS and MCAS)

Prodigy Platinum Learning Partner

Institute of IT Training - Accredited Training Provider Association of Computer Trainers Valid HTML 4.01 Transitional
Valid CSS Markup

secure online payments - visa - mastercard

Mini sitemap. These are the main areas of our web site. Full sitemap.

Training by application Main information pages See also

Access courses
DreamWeaver courses
Excel courses
MS Project courses
Outlook courses
PowerPoint courses
VBA courses
Word courses
(more...)

Public scheduled courses
On-site training
Closed company courses

Microsoft Office training
Pricing and availability
Training schedule
Training venues

Access training
Dreamweaver training
Excel training
MS Project training
PowerPoint training

London Computer Training
Computer Training London

Microsoft Access training
Microsoft Excel training
Microsoft Project training
Microsoft Outlook training
Microsoft Powerpoint training
Microsoft Word training

Time Management Course London

Interested in Access training? Please see the following pages:
microsoft access courses · microsoft training access course
microsoft+access+training · access courses in london

Training Information

Training Articles

AddThis Social Bookmark Button What's this?
Add to Del.icio.us Add to Facebook Add to Digg Add to Reddit Add to Google Add to Yahoo Add to Diigo Add to Mr. Wong Add to Linkarena Add to Power Oldie Add to Folkd Add to Jumptags Add to Upchuckr Add to Simpy Add to StumbleUpon Add to Slashdot Add to Netscape Add to Furl Add to Spurl Add to Blinklist Add to Blogmarks Add to Technorati Add to Newsvine Add to Blinkbits Add to Ma.Gnolia Add to Smarking Add to Netvouz