item number identifier
Microsoft Office TrainingThe UK's Number 1 for Microsoft Office Training Sitemap add this page to your favourites/bookmarksBookmark page
 
view a printable version of this pagePrintable version
Plus One Google
Customer: Sign in
Delegate: Sign in
Trainer: Log in

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Item number identifier

Item number identifier

resolvedResolved · Medium Priority · Version 2003

replyReplyTue 2 Feb 2010, 10:44Delegate Edmund said...

Item number identifier

Hi, I need to automatically give a list of asset data a unique number but each asset has 7 rows of information all of which must have the same asset number i.e for asset 1 these 7 rows must have 1 in the column next to them and then the next 7 rows must have number 2 next to them for asset number 2 etc etc e.g;
1 Description
1 Asset Category
1 Forecast NBV at Jan 2010
1 Monthly Depreciation
1 Start Date
1 End Date
2 Description
2 Asset Category
2Forecast NBV at Jan 2010
2 Monthly Depreciation
2 Start Date
2 End Date
How van I program VBA to do this? I assume its some kind of loop for 7 rows but how do I then give each block of 7 rows of data a different and sequential asset number? Hope you can help! Thanks.Ed.

For upcoming training course dates see: Pricing & availability

replyReplyWed 3 Feb 2010, 07:14Trainer Anthony said...

RE: item number identifier

Hi Edmund, thanks for your query. Try this code out on a blank worksheet first, then adapt to your own table of data:

sub listnumber()

Dim myuniquenumber As Integer
Dim currentrow As Integer
Dim thenumberoftimeiwanttodothis As Integer
Dim RowCount


myuniquenumber = 1
currentrow = 0

For thenumberoftimeiwanttodothis = 1 To 3

For RowCount = 1 To 7

currentrow = currentrow + 1

Cells(currentrow, 1).Value = myuniquenumber

Next RowCount


myuniquenumber = myuniquenumber + 1


Next thenumberoftimeiwanttodothis

End Sub



Hope this helps,

Anthony

replyReplyMon 8 Feb 2010, 16:49Delegate Edmund said...

RE: item number identifier and additional queries

Hi Anthony, thanks for your help however I am still really struggling to get to grips with VB for Excel. I am trying to write a macro to convert sections of data in rows in one sheet into columns in blocks of 8 in a new sheet whilst repeating the same 8 column headers within every block of 8. I have managed to write bits of code to get one block of 8 to work ok but I cannot work out how to do all the steps, transposes and loops and how to streamline everything to get all of the data converted.Can I send you my excel file so you can see what I mean and hopefully fix my code?

On another issue we have files that import data from an external software(Cognos) and then create pivot tables. Is it possible to create a user interface that selects the options for each pivot table to make it easier for the user instead of them having to go into the pivot table and pivot tabel wizard?

Hope you can help!

Kind regards,Ed.

replyReplyMon 8 Feb 2010, 16:51Delegate Edmund said...

RE: item number identifier and additional queries

Sorry - I meant that I needed to convert data from columns in one sheet into rows in a new sheet and not rows to columns as per my previous message!

 

 

Please browse our web site to find out more about
microsoft excel 2003 vba courses and other Microsoft training courses.

Excel tip:

Current date

CTRL+SEMICOLON

View all Excel hints and tips

forum postHello,

I would like to know how to change the font size of a label in a Userform - I can't see this property anywhere, and the only solution I have so far is to change the Label1.font.size value on activation.

Thanks all!

» Forum post: Label Font Size


Rate this page:
2.2/5 (213 votes cast)
Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses
Microsoft Certified Partner
Security Seal verified by visa, mastercard securecard

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

Management training

Professional Skills courses
Project Management Course London
Project Management Courses London
Project Management Training London
Project Management Training
Project Seminar
Project Seminars
Time Management Course London
Time Management London
Time Management Courses London
Time Management Training London
Introduction to Finance course
Assertiveness Skills course
Effective Communications Skills training
Presentation Skills London

Training Formats

Public scheduled courses
On-site training
Closed company courses

Consultancy
Application Development

Blogs

Excel Training
MS Project Training
Microsoft Training Blog

Version differences

Office 2010 vs 2007
MS Project version differences

Training Information

London Computer Training
Computer Training London
Docklands Training Courses
Docklands Training London

Training venues London
Client list
FAQ
Pricing and availability
Course details / Syllabus

Training Articles
Training Information

Microsoft training

Microsoft Office training
& IT Applications

Microsoft Project training
Microsoft Outlook training
Microsoft Powerpoint training
Microsoft Word training
MS Project courses
MS Project training
Outlook courses
PowerPoint courses
PowerPoint training
VBA courses
Word courses
Microsoft.training
(more...)

Excel Training

Excel courses
Excel Training Courses Medway
Autonumber in Excel
Microsoft Excel training
Basic Excel Courses
Basic Excel Course
Basic Excel Training

Interested in MS Access training?

Access courses
Microsoft Access training
Microsoft access courses
Microsoft training access course
Microsoft+access+training
Access courses in london

Training provider

Training providers
IT training companies
IT training providers
Management Training providers
Management Training provider

Event history, feedback results
Events in 2012 · 2011 · 2010 · More

See also

Crystal Reports training