+ Reply to Thread
Results 1 to 9 of 9

Replace across columns

  1. #1
    Registered User
    Join Date
    08-23-2019
    Location
    Tuncurry, Australia
    MS-Off Ver
    2010
    Posts
    4

    Replace across columns

    I am trying to use the Find/Replace function in Excel 2010 to find a particular cell and replace it and the (say) 3 cells to it's right with blanks.

    Something like replacing all the S123 's in :-

    S012 a 50 34
    S098 b 46 21
    S123 v 27 19
    S564 cc 11 67
    S123 v 27 19
    S577 f 45 21

    to become
    S012 a 50 34
    S098 b 46 21

    S564 cc 11 67

    S577 f 45 21

    I'd prefer NOT to use VBA coding.
    Any suggestions please
    Ken

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,780

    Re: Replace across columns

    Welcome to the forum.

    What you are describing is not possible with formulae. It would need VBA, I am afraid.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    08-23-2019
    Location
    Tuncurry, Australia
    MS-Off Ver
    2010
    Posts
    4

    Re: Replace across columns

    Thanks..
    I was hoping that there could be something like {"","","",""} which is the syntax used when one defines a Name across several blank columns

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,780

    Re: Replace across columns

    You cannot replace cell contents using formulae. Cells can contain manually entered data or a formula, but not both.

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,724

    Re: Replace across columns

    You can use Find & Replace (CTRL-H) to replace all the S123's in column A, if you highlight the column first and do it in one operation. You would then have to manually move down to the next empty cell in column A (END key followed by Down-Arrow), then select the 3 cells to the right (i.e. v 27 19) then press the delete key, and then repeat this for all the other blanks in column A.

    Hope this helps.

    Pete

  6. #6
    Registered User
    Join Date
    08-23-2019
    Location
    Tuncurry, Australia
    MS-Off Ver
    2010
    Posts
    4

    Re: Replace across columns

    Thanks Pete,
    I'm actually doing similar to that. The problem is that there are multiple ( had 36 in one workbook) that require deletion and nulls in the cells to the right.
    Repeating your sequence is rather time consuming.

  7. #7
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,724

    Re: Replace across columns

    That's why AliGW said in Post #2 that you would need VBA - you won't be able to do it with a formula.

    Well, you could, in fact, use 4 formulae in different columns. For example, if your data occupies columns A to D, then you could use these formulae in the cells stated:

    F1: =IF(A1="S123","",A1)

    G1: = IF($F1="","",B1)

    then copy G1 into H1 and I1, then copy those formulae down as far as you need them.

    You could then fix the values, and then delete columns A to E, and that manual operation will not take up a lot of time.

    Hope this helps.

    Pete

  8. #8
    Registered User
    Join Date
    08-23-2019
    Location
    Tuncurry, Australia
    MS-Off Ver
    2010
    Posts
    4

    Re: Replace across columns

    Thanks again Pete. I had considered something similar but the problem is the item to delete changes AND there are thousands of rows spread over 8 worksheets (Monday,Tuesday, etc ) . The find and replace option seems the simplest. I am currently using Find, then pasting 4 blank cells over each occurrence . A bit tedious when done 36 times. A macro would help but would still need to execute the macro multiple (perhaps 36 ) times.

  9. #9
    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,933

    Re: Replace across columns

    excel is good but it cant do the impossible. I think you have had all the suggestions you are going to get for this
    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

+ 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] Replace text in columns
    By flojdian in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 06-17-2016, 06:45 AM
  2. Find and replace but replace value of cell 3 columns along
    By batchjb69 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-05-2014, 10:57 AM
  3. [SOLVED] Replace columns with the value instead of the formula
    By Lowerysgirl in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-29-2012, 01:54 PM
  4. [SOLVED] Search and replace in multiple columns
    By ajm1949 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-01-2012, 03:56 AM
  5. Compare columns and replace values?
    By llckll in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-30-2010, 02:51 PM
  6. Find and replace based on columns .. Help!
    By khaos in forum Excel General
    Replies: 9
    Last Post: 12-28-2006, 10:21 AM
  7. Replace formula's in two columns with the value's with VBA
    By Les Stout in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-31-2005, 11:05 AM

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