+ Reply to Thread
Results 1 to 10 of 10

Convert object as string

  1. #1
    Registered User
    Join Date
    12-21-2010
    Location
    Bucharest,Romania
    MS-Off Ver
    Excel 2003
    Posts
    5

    Convert object as string

    Hi,

    I am very new in macros and also on this forum and I need some help.

    I have one column filled with several names. I want to loop in the column and check the first 2 letters(if are equal with string "In") from each name and after to put the names in a new column or in a new sheet or in a new workbook.

    This is the code that I wrote until now:

    Please Login or Register  to view this content.
    How should I proceed to recognize the ActiveSheet.Range("C:C").Value as a string, so that to be able to work with strings after in the for loop?


    Thank you very much for your help!
    Last edited by romperstomper; 12-21-2010 at 12:24 PM. Reason: add tags

  2. #2
    Registered User
    Join Date
    12-21-2010
    Location
    Bucharest,Romania
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Convert object as string

    Hello all,

    Anyone here who could help me ??

    thanks a lot!
    Last edited by DonkeyOte; 12-22-2010 at 05:08 AM. Reason: edited so as to remove unnecessary quote

  3. #3
    Forum Contributor johnjohns's Avatar
    Join Date
    11-19-2007
    Location
    Dubai, UAE
    MS-Off Ver
    2003 and 2007
    Posts
    526

    Re: Convert object as string

    Why don't you do this with a filter. ie is Custom Autofilter->Begins with

    rgds

    johnjohns

  4. #4
    Registered User
    Join Date
    12-21-2010
    Location
    Bucharest,Romania
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Convert object as string

    Yes, but I need to select only values starting with "In" and I cannot do this with Custom filter.
    Let me give example, to be more clear.
    My column contains several values like:Atmel, AVX, Infineon, Avago, Microsoft, Kemet,...and so on.
    I want to loop this column and for each cell to check which values start with "In"(for example Infineon) and to extract these values in a separate column.

    Thank you!!
    Last edited by DonkeyOte; 12-22-2010 at 05:08 AM. Reason: removed unnecessary quote

  5. #5
    Forum Contributor johnjohns's Avatar
    Join Date
    11-19-2007
    Location
    Dubai, UAE
    MS-Off Ver
    2003 and 2007
    Posts
    526

    Re: Convert object as string

    Can you post a sample w.book? Also see the attachment where I have done the filtering for all the values starting with "In"

    rgds

    johnjohns
    Attached Files Attached Files

  6. #6
    Forum Contributor johnjohns's Avatar
    Join Date
    11-19-2007
    Location
    Dubai, UAE
    MS-Off Ver
    2003 and 2007
    Posts
    526

    Re: Convert object as string

    Also your title do not match with your requirement. Please read the forum rules

    rgds

    johnjohns

  7. #7
    Registered User
    Join Date
    12-21-2010
    Location
    Bucharest,Romania
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Convert object as string

    Quote Originally Posted by johnjohns View Post
    Also your title do not match with your requirement. Please read the forum rules

    rgds

    johnjohns
    Thank you for your Custom filter solution.
    I attached a sample with a list.
    What I was trying to do is to make the extraction using a macro.and I don;t figure out how to loop each value in each cell and to check the first two letters from each value. Because I cannot match an object with a string...this is the reason why my post is about convert an object to a string...Am I wrong?
    I will try from now on to be very very specific with my title, because I already read the forum rules.
    Thank you again for understanding and for help.

    sincerely,
    LTA
    Attached Files Attached Files

  8. #8
    Forum Contributor johnjohns's Avatar
    Join Date
    11-19-2007
    Location
    Dubai, UAE
    MS-Off Ver
    2003 and 2007
    Posts
    526

    Re: Convert object as string

    is it this way?
    Please Login or Register  to view this content.
    rgds

    johnjohns

  9. #9
    Registered User
    Join Date
    12-21-2010
    Location
    Bucharest,Romania
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Convert object as string

    Quote Originally Posted by johnjohns View Post
    is it this way?
    Please Login or Register  to view this content.
    rgds

    johnjohns


    Yes, that is perfect. Thanks a lot! I consider this subject closed.
    With respect,
    LTA

  10. #10
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Convert object as string

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save
    Remember what the dormouse said
    Feed your head

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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