+ Reply to Thread
Results 1 to 6 of 6

Find all - delete BUT the cell [x] columns to the right

  1. #1
    Registered User
    Join Date
    12-17-2013
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    15

    Find all - delete BUT the cell [x] columns to the right

    In one column I have dates for the 2013 year and corresponding stock prices (for a large number of stocks). So the 2013 dates repeat each other in the one column for each new stock.

    In another column I have "Change in price" using a (today-yesterday)/yesterday but when the year restarts the formula is redundant (first day of the year has no yesterday so needs to be blank, instead it uses the last day of the year of the above stock).

    I figured the easiest way to do this is by mass deleting the cell adjacent to 01/01/2013. So it's like a Find All "01/01/2013", Delete but I need to offset it by 9 columns.

    Thanks for help in advance.

    n.b. each stock has different year lengths so I can't make a macros to delete every [n]th cell

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Find all - delete BUT the cell [x] columns to the right

    Maybe you could include siomething in your formula that tests for a new year, then adjust your formula accordingly?

    =if(year(a1)=year(a2),regular-formula,new-year-formula)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    12-17-2013
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Find all - delete BUT the cell [x] columns to the right

    if there is a way to test just the year in a cell involving a date I don't know how to do it

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Find all - delete BUT the cell [x] columns to the right

    I just showed you how...my example used the YEAR() function to pull out the year

  5. #5
    Registered User
    Join Date
    12-17-2013
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Find all - delete BUT the cell [x] columns to the right

    ahh I didn't realise! Thanks I will give it a whirl

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Find all - delete BUT the cell [x] columns to the right

    No problem, I should have used CAPS

+ 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. [SOLVED] More efficient way to find and delete columns
    By agentblue in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 04-30-2013, 11:47 AM
  2. Find columns and delete them
    By robertguy in forum Excel General
    Replies: 0
    Last Post: 08-09-2012, 10:54 AM
  3. Macros: find certain text and delete columns
    By Womble6 in forum Excel General
    Replies: 3
    Last Post: 05-11-2011, 01:27 PM
  4. Find empty columns, rows and delete
    By ebe in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-27-2010, 10:00 AM
  5. Replies: 3
    Last Post: 03-19-2009, 09:11 AM

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