+ Reply to Thread
Results 1 to 2 of 2

Pass a variable to another subroutine and get back the result

  1. #1
    Registered User
    Join Date
    11-15-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2007
    Posts
    97

    Pass a variable to another subroutine and get back the result

    Hi,

    In my application, I read the contents of a cell which contains the full name. I need to split the full name into the three components - Surname, First Name and the Middle Name.

    In my code I read the full name and pass this to another subroutine to split the full name into Surname, First Name and Middle Name. This portion seems to work fine. Where I am having a problem is getting back the Surname, First Name and Middle Name after the split. This comes back empty. The code is posted below. Would be really grateful if some one can point out the mistake I have made and give me correct code.

    Please Login or Register  to view this content.
    xlLastRow is a function written to get the first blank row in the worksheet. There is no problem with this routine.

    Thanks a ton in advance

    Anand

  2. #2
    Registered User
    Join Date
    11-09-2009
    Location
    london, england
    MS-Off Ver
    Excel 2010
    Posts
    52

    Re: Pass a variable to another subroutine and get back the result

    Hi anandvh

    I copied your SplitMemName code and declared sMemSurN, sMemFirN, sMemMidN as global variables (this was an assumption). I got it to work by making one small change.
    Replace
    Please Login or Register  to view this content.
    With
    Please Login or Register  to view this content.
    Test with this code
    Please Login or Register  to view this content.
    Hope this helps.
    Please click * if the answer was helpful.

+ 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