+ Reply to Thread
Results 1 to 4 of 4

Find the position of number one and restore the corresponding letters.

Hybrid View

  1. #1
    Registered User
    Join Date
    11-18-2015
    Location
    qatar
    MS-Off Ver
    2010
    Posts
    61

    Find the position of number one and restore the corresponding letters.

    Hi all,

    Suppose cell has 15 characters 0 and 1,I want the letters corresponding to the position of number 1 placed together.
    For details, see the sample files.
    Thank you.
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2024
    Posts
    6,182

    Re: Find the position of number one and restore the corresponding letters.

    Use VBA:
    Public Function Conve(StrText As String) As String
    Dim i As Long
        For i = 1 To Len(StrText)
            If Mid(StrText, i, 1) = "1" Then Conve = Conve & ChrW(96 + i)
        Next
    
    End Function
    Attached Files Attached Files

  3. #3
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    27,020

    Re: Find the position of number one and restore the corresponding letters.

    I have provided two ways to do this, one with a formula and one with a user-defined function (macro). The formula is long, one IF for each character position. The macro is cleaner to use if you don't mind macros.
    Attached Files Attached Files
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  4. #4
    Registered User
    Join Date
    11-18-2015
    Location
    qatar
    MS-Off Ver
    2010
    Posts
    61

    Re: Find the position of number one and restore the corresponding letters.

    Answers worked properly...
    Thank you both very much for your time with this, much appreciated

+ 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. [SOLVED] Find number in position 'x'
    By Sedge in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-04-2012, 10:02 PM
  2. find position of a number in a string
    By Dave Peterson in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-06-2005, 08:05 PM
  3. find position of a number in a string
    By Dave Peterson in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-06-2005, 05:05 PM
  4. find position of a number in a string
    By fullers80 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 04:05 PM
  5. find position of a number in a string
    By fullers80 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 PM
  6. [SOLVED] find position of a number in a string
    By fullers80 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 PM
  7. find position of a number in a string
    By fullers80 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 11:05 AM
  8. find position of a number in a string
    By fullers80 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 09: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