+ Reply to Thread
Results 1 to 9 of 9

Excel 2007 : Moving a Range Based on Variable Text Value

  1. #1
    Registered User
    Join Date
    06-11-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    46

    Moving a Range Based on Variable Text Value

    Hello,

    I am trying to laterally move User IDs from Column A Column R.

    Daily, the Users change (User ID: 7000, User ID: 7800), however they always start with the phrase "User ID: ".

    The row location of the User IDs also change, but they are always in Column A.

    Here is the code I tried. When I run it, it does absolutely nothing:

    Please Login or Register  to view this content.
    Any help would be appreciated. Thank you, in advance.
    Last edited by KSSLR; 06-12-2012 at 01:03 PM.

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Moving a Range Based on Variable Text Value

    KSSLR,

    Welcome to the forum!
    Give this a try:
    Please Login or Register  to view this content.
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    06-11-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    46

    Re: Moving a Range Based on Variable Text Value

    Hello tigeravatar,

    I ran this, and nothing happened. But thank you for your effort.

  4. #4
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Moving a Range Based on Variable Text Value

    KSSLR,

    Attached is an example workbook based on the criteria you described. It contains the macro code I posted earlier. Running that code results in the user IDs being copied to column R as requested.

    Does your workbook have a different layout?
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    06-11-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    46

    Re: Moving a Range Based on Variable Text Value

    I was able to move only one User ID over, using both of our codes. It appears that it's the "User ID*" that is making things more difficult:

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    06-11-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    46

    Re: Moving a Range Based on Variable Text Value

    tigeravatar: you are a genius! Thank you! I used *User ID* as the search term, in case there were a variable amount of spaces preceeding the User ID. There were. Your code did the job. Thanks for your help. I spent hours trying to figure this out on my own.

  7. #7
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Moving a Range Based on Variable Text Value

    Hi KSSLR,

    You could try:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  8. #8
    Registered User
    Join Date
    06-11-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    46

    Re: Moving a Range Based on Variable Text Value

    xladept: That was exactly what I was trying to do. Thanks!

  9. #9
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Moving a Range Based on Variable Text Value

    Hi KSSLR,

    You're welcome.

+ 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