exceeding characters
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 Excel VBA Training and Help » Exceeding Characters

Exceeding Characters

The UK's most regular instructor-led training courses.
Training information: vba-excel-training · Excel training course · Microsoft Office VBA training

resolvedResolved · Urgent Priority · Version 2003

Exceeding Characters

Rebecca has attended:
Excel Advanced course

by - delegate Rebecca [14 posts] (2008 Apr 14 Mon, 15:58) replyReply

Hi,

I have written a code that looks at a specific cell reference in a datasheet.

The lines that contain the specific cell reference are then moved to their own individual worksheet within the same workbook.

The new worksheet is then re-named as the cell reference, however some names exceed the 31 characters allowed to rename a worksheet.

Can you tell me how to resolve the problem

Many thanks

Becky

Excel Intermediate 1 day course
Version Date Location Places
available
Book Next place rate:
Card Invoice
2007 2008 Aug 12 Tue Bloomsbury 0 FULL    
2003/XP 2008 Aug 12 Tue Tooting 0 FULL    
2003/XP 2008 Aug 14 Thu Southwark 0 FULL    
2007 2008 Aug 19 Tue Bloomsbury 5 book now £212 £224
2003/XP 2008 Aug 21 Thu Bloomsbury 3 book now £210 £215
2003/XP 2008 Aug 21 Thu Bayswater 4 book now £195 £205
Full Schedule: See all 145 Excel Intermediate course dates.
Bookings currently available until 25th November 2009.

RE: Exceeding Characters

by - trainer Stephen gold contributer[306 posts] (2008 May 21 Wed, 15:36) replyReply

Hi Rebecca

Thank you for your question

First let me aplologise for the delay in replying to your question. We have had very high volumes of posts and as a result there have been a number of delays in responding questions.

Assuming you haven't already resolved the issue, can I suggest you email me a copy of the workbook to stephenATmicrosofttraining.net and I will consider the problem as a matter of urgency

Regards

Stephen

RE: Exceeding Characters

by - delegate Rebecca [14 posts] (2008 May 22 Thu, 15:42) replyReply

Good afternoon Stephen,
Many thanks for your help with my code regarding excedding the maimum name length for worksheets. I have used the code you sent me which is naming the worksheets within the characters permitted, however from the "C&1" report isn't coming across, the sheet just remains blank and I can't find the problem with it!!!

Would it be possible to help me anymore on this one??
Many thanks
Becky

RE: Exceeding Characters

by - trainer Stephen gold contributer[306 posts] (2008 May 22 Thu, 10:44) Edited on 2008 May 22 Thu, 10:45 replyReply

Hi Rebecca

Thanks for your question and for the file

I have looked at the problem, and the first thing to state is that you cannot exceed the maximum name length and therefore you need a strategy for naming your sheets. As any company name that exceeds the maximum length will comprise two or more words, I suggest just using the first word of the name as the sheet title. For example "Best Training", would become be titled "Best".

I have modified your AskForSupplier procedure as follows

Sub AskForSupplier()


Dim intLength As Integer
Dim strTitle As String


Call DeleteSheetIfExists


Worksheets.Add after:=Worksheets(Worksheets.Count)

intLength = Application.WorksheetFunction.Find(" ", txtSupplier)

strTitle = Left(txtSupplier, intLength)

ActiveSheet.Name = strTitle
Sheets("C&I").Select

End Sub


The strategy is to use the worksheet function FIND to locate the first space in the supplier name, and then to use this in the VBA function LEFT, to trim off the first name and set it equal to the variable strTitle.

Hope this is useful

If this strategy is not suitable please let me know so we can explore other options

Regards

Stephen


Related articles

· How to Create Better Excel Spreadsheets: Part Four
· Take the Anxiety out of Domestic Finances with Microsoft Excel
· 5 Microsoft Excel Charts for Creating Stunning Business Documents
· Reasons Why VBA for Excel Training Fails
· Prepare for your MOS Certification with MS Excel Courses

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

Excel tip:

Using Excel's MODE function

Use Excel's MODE function to display the most common value present in a particular range of cells.

The Mode function looks like this:

=MODE(cell range)

As an example, if 35 is the most commonly recurring number in a particular cell range, then the function will display 35.

View all Excel hints and tips

Institute of IT Training - Accredited Training Provider Institute of IT Training - Accredited Training Provider Prodigy Platinum Learning Partner Microsoft Office Specialist Authorised Testing Centre

Microsoft Registered Partner
microsoft office
ms office project server

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
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