Loading
Ozgrid Excel Help & Best Practices Forums

Excel Video Tutorials / Excel Dashboards Reports



Results 1 to 4 of 4

Thread: Get Each Letter From String

  1. #1
    Join Date
    18th October 2006
    Posts
    38

    Get Each Letter From String

    HIi again for everybody. As you can know I'm a new user for VBA. I learn to program in C. Somethings for VBA are easy somethings no.

    But there is my question:

    Can I use a string in VBA just like C.
    I'm trying to get character one by one for a string.
    Can I do somehting like that here?

    In C I use:
    char string[20];
    For ( int i = 0; string[i] != '\0"; i++)
    cout << string[i];
    Last edited by Jack in the UK; October 28th, 2006 at 18:34.

    Excel Video Tutorials / Excel Dashboards Reports


  2. #2
    Join Date
    9th June 2006
    Location
    The best city, in the best state, in the best country, in the known inhabited universe, Houston, TX
    Posts
    966

    Re: Use Strings Like C

    Ed_Kerrigan,

    You may get more help if you try to say in words what you want to accomplish without the C code (I can't read C).

    Jim

    Excel Video Tutorials / Excel Dashboards Reports


  3. #3
    Join Date
    24th January 2003
    Location
    Australia
    Posts
    31,708

    Re: Use Strings Like C

    Ed, as you problem is getting each letter from a String, why not use something like that for your Thread Title?

    POOR THREAD TITLE Please read THIS PAGE IN FULL

    VB:
    Sub GetLetters() 
        Dim strArray() As String 
        Dim strText As String 
        Dim lLoop As Long, lCount As Long 
         
        strText = "Hello" 
        lCount = Len(strText) 
        Redim strArray(lCount - 1) 
         
        For lLoop = 0 To lCount - 1 
            strArray(lLoop) = Mid(strText, lLoop + 1, 1) 
        Next lLoop 
         
        Range("A1:A" & lCount) = WorksheetFunction.Transpose(strArray) 
    End Sub 
    
    

  4. #4
    Join Date
    18th October 2006
    Posts
    38

    Re: Use Strings Like C

    Thaks Dave to remember me the rules.
    I'll try to follow it.
    Thank to for the answer

    Excel Video Tutorials / Excel Dashboards Reports


Thread Information

Users Browsing this Thread

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

Possible Answers

  1. Extract The First Letter Of A String
    By dmcbride01 in forum EXCEL HELP
    Replies: 3
    Last Post: December 7th, 2011, 01:02
  2. Insert Column Macro Based Variable String Letter
    By rocketrye12 in forum EXCEL HELP
    Replies: 4
    Last Post: June 11th, 2008, 03:15
  3. Replies: 1
    Last Post: August 4th, 2006, 03:16
  4. Formating letter colors inside string
    By Shiroten in forum EXCEL HELP
    Replies: 4
    Last Post: October 8th, 2005, 02:32
  5. How to get a letter out of a string
    By e7macka in forum EXCEL HELP
    Replies: 3
    Last Post: May 11th, 2004, 17:42

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