+ Reply to Thread
Results 1 to 3 of 3

Manipulating Strings in VB

  1. #1
    Registered User
    Join Date
    08-22-2014
    Location
    Abilene, KS
    MS-Off Ver
    2013
    Posts
    6

    Manipulating Strings in VB

    Hello All,

    I am a new user to Visual Basic so I'm afraid this is a fairly primitive question. I am trying to create a function that will give a number whose digits go from 1 to specified value, 11 should give 1234567891011. I made the code below:

    Function LONGNUM(x As Integer) As String
    Dim i As Integer, text As String, Answer As Long
    For i = 1 To x
    text = text & CStr(i)
    Next i
    Answer = CLng(text)
    LONGNUM = reversedText
    End Function

    All integer inputs produce absolutely nothing. What am I doing wrong? Thanks for all the help in advance.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2003,2007,2010
    Posts
    34,273

    Re: Manipulating Strings in VB

    Hello and welcome to the forum

    Please take a few moments to read the forum rules (see below, in particular)

    Please Login or Register  to view this content.


    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here
    Trevor Shuttleworth - Excel Aid

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert Debraj Roy's Avatar
    Join Date
    09-27-2012
    Location
    New Delhi,India
    MS-Off Ver
    Excel 2013
    Posts
    1,469

    Re: Manipulating Strings in VB

    Try this..

    Please Login or Register  to view this content.
    Regards!
    =DEC2HEX(3563)

    If you like someone's answer, click the star to give them a reputation point for that answer...

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Manipulating strings in VBA
    By Mordred in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 10-27-2010, 01:36 PM
  2. Manipulating strings
    By therealjag in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-29-2010, 08:32 AM
  3. Manipulating Text strings
    By xmoore in forum Excel General
    Replies: 13
    Last Post: 01-15-2010, 07:16 AM
  4. Manipulating Strings
    By OlYeller21 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-06-2009, 02:08 PM
  5. Manipulating Strings
    By Leslie Coover in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-27-2005, 02:05 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1