Closed Thread
Results 1 to 4 of 4

Drag and drop a formula down a single column

  1. #1
    Forum Contributor
    Join Date
    01-05-2010
    Location
    New York
    MS-Off Ver
    Excel 2016
    Posts
    747

    Drag and drop a formula down a single column

    In B4 is the word "T Equity". I need a macro to isolate "T" and copy it from A6:T217. Then do the same for the next example "MSFT Equity" in B219 and isolate MSFT and copy it from A221:A256. Do the same form WMT Equity in B258 ect... (More examples will be added over time).

    In column A, I have the formula =LEFT($B$4,SEARCH(" ",$B$4)-1) that demonstrates exactly how I would like the data to look. Eventually I am going to have hundreds of these examples and need a macro to perform this task easily.

    Can anyone help me out with this? Thanks
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Drag and drop a formula down a single column

    This formula can be entered into A6 and dragged down through infinity.

    =IF(OR(ISBLANK(B6),ISTEXT(B6)),"",IF(AND(ISNUMBER(B6),ISTEXT(B5)),LEFT(B4,SEARCH(" ",B4)-1),A5))

    Does that work for you?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

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

  3. #3
    Forum Contributor
    Join Date
    01-05-2010
    Location
    New York
    MS-Off Ver
    Excel 2016
    Posts
    747

    Re: Drag and drop a formula down a single column

    Thanks this is perfect!

    On more question. I need a macro to scan through column I, and if there is a "1" then copy the row with the "1" in it and also copy one row below and paste both rows into a new sheet. Is it possible for this to be done?

  4. #4
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Drag and drop a formula down a single column

    Please do not start a new question in the same thread. Instead, start a new one.
    Thread closed

Closed 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