+ Reply to Thread
Results 1 to 3 of 3

Grabbing text from just part of a cell

  1. #1
    Registered User
    Join Date
    01-05-2006
    Posts
    6

    Grabbing text from just part of a cell

    Hi all,

    I have sheets that come in that include a cell that says, for instance, 'Subject no.: 5'. How would I grab just the '5' part of that cell?

    Help appreciated, thanks!

  2. #2
    Kevin B
    Guest

    RE: Grabbing text from just part of a cell

    The following function will grab whatever follows the colon space:

    Function SubjectNum(InitialValue As String) As String

    Dim l As Long

    'Find the location of the colon and add 1 for the space
    l = InStr(1, InitialValue, ":") + 1

    SubjectNum = Right$(InitialValue, Len(InitialValue) - l)

    End Function

    --
    Kevin Backmann


    "Mary T" wrote:

    >
    > Hi all,
    >
    > I have sheets that come in that include a cell that says, for instance,
    > 'Subject no.: 5'. How would I grab just the '5' part of that cell?
    >
    > Help appreciated, thanks!
    >
    >
    > --
    > Mary T
    > ------------------------------------------------------------------------
    > Mary T's Profile: http://www.excelforum.com/member.php...o&userid=30151
    > View this thread: http://www.excelforum.com/showthread...hreadid=498349
    >
    >


  3. #3
    Registered User
    Join Date
    01-05-2006
    Posts
    6
    That worked great, thanks!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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