+ Reply to Thread
Results 1 to 3 of 3

how to add counter and change replace to delete cells?

  1. #1
    Registered User
    Join Date
    10-07-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    18

    how to add counter and change replace to delete cells?

    Hi, I have a macro which will search a document in specific range and find specific cells if found = replaced to data from my list ...

    I want to change it to: if found = delete cell + delete 4 cells on left...

    +
    at the end i want to see msg bog saying how many time it find the spec cells... (not how many cells has been deleted.

    Sub Find()
    Dim myList, myRange
    Set myList = Sheets("sheet3").Range("A1:A10")
    Set myRange = Sheets("sheet3").Range("D1:F100")
    For Each cel In myList.Columns(1).Cells
    myRange.Replace what:=cel.Value, replacement:=cel.Offset(0, 1).Value
    Next cel
    End Sub


    Thank you

  2. #2
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: how to add counter and change replace to delete cells?

    Makes no sense. What are you searching for? And what are you replacing with?
    Be fore warned, I regularly post drunk. So don't take offence (too much) to what I say.
    I am the real 'Napster'
    The Grid. A digital frontier. I tried to picture clusters of information as they moved through the computer. What did they look like? Ships? motorcycles? Were the circuits like freeways? I kept dreaming of a world I thought I'd never see. And then, one day...

    If you receive help please give thanks. Click the * in the bottom left hand corner.

    snb's VBA Help Files

  3. #3
    Registered User
    Join Date
    10-07-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    18

    Re: how to add counter and change replace to delete cells?

    I am searching for data from sheet 3 A1:a10
    and replacing data in sheet 3(or different) in range D1:F100

    -so for example if i have on sheet3 in A1= Car and B1= Blue
    it will look at D1:F100 and replace every word Car to word Blue..... if there is no blue and its blank it will replace Car to blank cell


    What i would like is to instead of replacing delete the cell where is car and also delete 4 cells on the left of Car

    At the end to display how many times we found word Car and clear/ deleted this cell...

    Hope its better now

+ 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. Replies: 1
    Last Post: 03-26-2013, 01:55 PM
  2. Macro to replace cells value automatically based on another cell change event
    By phsilverhp in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-09-2011, 04:36 AM
  3. macro - look for change in cell, delete other cells
    By davidmangano in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-18-2011, 02:44 PM
  4. [SOLVED] Counter to delete a row
    By ChrisM in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-25-2006, 11:50 PM
  5. In Excel how do I delete or change the name of a range of cells?
    By Naming and Deleting a Range Name in forum Excel General
    Replies: 3
    Last Post: 05-01-2005, 09:06 PM

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