+ Reply to Thread
Results 1 to 5 of 5

If conditional copying of URL to another cell?

  1. #1
    Registered User
    Join Date
    02-14-2014
    Location
    Israel
    MS-Off Ver
    Excel 2007
    Posts
    19

    Question If conditional copying of URL to another cell?

    Hello, what I need is to copy URLs that contain /forum or /forum/ from one cell to another:

    Please Login or Register  to view this content.
    There are www. and http://www. versions but my purpose is to copy cells as long as they have above criteria in them. I would also be interested to know if it is possible to move data in addition to copying data ro another cell.

    Thanks

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: If conditional copying of URL to another cell?

    Formulas and functions can't MOVE data from it's original position, it can only show you new data based on the original data. Moving the original data would require some manual steps, or VBA programming.

    If the list is in column A, this formula will create a list in column B with blank spaces, in B1 and copied down:

    =IF(ISNUMBER(SEARCH("forum", A1)), A1, "")



    If you want a list with no spaces, you will need an array formula and a specified range of cells. In B1 enter this array formula:

    =IFERROR(INDEX($A$1:$A$6, SMALL(IF(ISNUMBER(SEARCH("forum", $A$1:$A$6)), ROW($A$1:$A$6), ""), ROW($A1))), "")

    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.

    Now copy B1 down a ways until the answers stop appearing.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    02-14-2014
    Location
    Israel
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: If conditional copying of URL to another cell?

    Thank you!

    The first formula worked for me but second just left blank cells.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: If conditional copying of URL to another cell?

    The second will work, but you have to do the Control+Shift+Enter together properly to activate the array. If you just press ENTER it won't work. CTRL+SHIFT+ENTER and then you will see curly braces { } appear around your formula.

  5. #5
    Registered User
    Join Date
    02-14-2014
    Location
    Israel
    MS-Off Ver
    Excel 2007
    Posts
    19

    Post Re: If conditional copying of URL to another cell?

    Did what you suggested and saw curly braces appearing.
    Dragged cells and black spaces is all I have got.

  6. #6
    Registered User
    Join Date
    02-14-2014
    Location
    Israel
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: If conditional copying of URL to another cell?

    I wonder if I can use above script but slightly modified to solve problem I describe in this thread.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Copying Entire row based off cell value or conditional cell colour
    By jpl4412 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-01-2013, 10:03 AM
  2. Copying conditional formatting from Vlookup cell
    By dammfast in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-06-2009, 08:16 AM
  3. Conditional formatting and copying a cell format
    By smartfab in forum Excel General
    Replies: 1
    Last Post: 09-10-2008, 11:37 PM
  4. Replies: 2
    Last Post: 09-03-2008, 08:56 AM
  5. Copying Conditional Formatting Colors from a Cell
    By Ridgebacks in forum Excel General
    Replies: 3
    Last Post: 10-12-2007, 07:31 PM

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