Wrox Programmer Forums
|
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 April 25th, 2005, 05:38 AM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default Chr$

What is the Chr$ doing here?

Code:
Chr$(iOnes + 64)
www.crmpicco.co.uk
www.crmpicco.co.uk.tt
www.milklemonadechocolate.uk.tt
www.griswolds.uk.tt
www.piccosmini.co.uk.tt
www.morton.uk.tt
__________________
_______________________
Ayrshire Minis - a Mini E-Community
http://www.ayrshireminis.com
http://www.crmpicco.co.uk
 
Old April 25th, 2005, 05:55 AM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 180
Thanks: 0
Thanked 0 Times in 0 Posts
Default

CHR$ is the VB code for an ASCII based character symbolised by a number. for example chr$(64) is ascii code for A therefore I can only assume it is being presented with the variable iOnes which by definition must be an integer otherwise an error will occur, say the value of iOnes is 15, it is adding the two figures together 15+64 to cget 79, which in ASCII represents a capital O.

 
Old April 25th, 2005, 10:13 AM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Actually 65 is the ASCII for A.
So in this case if iOnes = 1, it would give the 1st letter of the alphabet (the first capital letter).
So in this case if iOnes = 26, it would give the 26th capital letter of the alphabet, “Z”.
Code:
    Chr$(iOnes + 96)
would do the same thing with the lowercase letters of the alphabet.

Say: What are all those websites? (I’m not going without a little knowledge of what I might be getting into...)
 
Old April 26th, 2005, 02:44 AM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 180
Thanks: 0
Thanked 0 Times in 0 Posts
Default

well, thats what you get for trying to be too much of a smartass and not remembering to tie up my shoelaces!!! lol

Matt
aka crazypabs






Similar Threads
Thread Thread Starter Forum Replies Last Post
C# equivalent function to VB chr for values > 128 relaytest49 ASP.NET 2.0 Professional 0 May 24th, 2006 10:08 AM
CHR(13) errors in CDO.CreateMHTMLBody() janaka44 Classic ASP Professional 0 April 5th, 2006 11:08 PM
syntax for storing chr(0) in sql server through vb neeraj.khattar Beginning VB 6 1 January 10th, 2005 02:20 PM
chr function erin SQL Language 6 December 5th, 2003 06:30 PM





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