+ Reply to Thread
Results 1 to 3 of 3

Fill down a column using right(), skipping rows, VBA

  1. #1
    Valued Forum Contributor
    Join Date
    10-21-2011
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    513

    Fill down a column using right(), skipping rows, VBA

    Hi there,

    I have a column that contains texts. Please see the attached file.

    What I would like to do

    1) In col B, starting at B2, I need to use the =right(A2, 5) to extract only the 5 digit number from all the FC rows
    2) fill down the column B

    The difficulty is that....the "text" argument in the =right() must be ONLY in the FC rows. (basically the 5 digit number needs to be put right beside each primary account, as shown in the sample file)

    How shall a macro easily help me do the job?

    Thank you
    Attached Files Attached Files
    Last edited by Lifeseeker; 03-17-2012 at 04:30 PM.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Fill down a column using right(), skipping rows, VBA

    Hi,

    You don't need a macro.

    One way with a standard excel function is
    =IF(LEFT(A2,2)="FC",RIGHT(A2,6),B1)
    in B2 and copied down

    Regards
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Valued Forum Contributor
    Join Date
    10-21-2011
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    513

    Re: Fill down a column using right(), skipping rows, VBA

    ah......I see I see......

    I wonder why I didn't think of that!

    Thank you!

+ 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