+ Reply to Thread
Results 1 to 6 of 6

Find all cells with value in column and replace !

  1. #1
    Forum Contributor
    Join Date
    12-05-2008
    Location
    Kiruna
    Posts
    163

    Find all cells with value in column and replace !

    Hi

    Is it possible with VBA to find all cells in a column with a value and replace it with a number (1)


    I have a column that looks like this:

    Column L
    1 "Blank"
    2 (1-0
    3 "Blank"
    4 "Blank"
    5 "Blank"
    6 2-0)
    7 1-0
    8 "Blank"
    9 "Blank"
    10 3-0

    I want to search the column for every row that contains a value and replace it by 1 (ignoring the blank rows)
    like this:

    Column L
    1 "Blank"
    2 1
    3 "Blank"
    4 "Blank"
    5 "Blank"
    6 1
    7 1
    8 "Blank"
    9 "Blank"
    10 1

    Is this possible ?

    Best regards

    Petter
    Last edited by Petter120; 10-28-2012 at 08:18 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    03-17-2012
    Location
    Warsaw, Poland
    MS-Off Ver
    2007/2010
    Posts
    555

    Re: Find all cells with value in column and replace !

    just select the desired range, press ctrl+h and enter * in the "find what" field and put 1 in the replace with field. Then proceed to "replace all" and voila - your task is done without vba.
    If you think that my answer was helpful, please click on the "Add to this user's Reputation" button.

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,099

    Re: Find all cells with value in column and replace !

    One way:

    Please Login or Register  to view this content.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,099

    Re: Find all cells with value in column and replace !

    And the code for bishonen's approach is:

    Please Login or Register  to view this content.

    Regards, TMS

  5. #5
    Forum Contributor
    Join Date
    12-05-2008
    Location
    Kiruna
    Posts
    163

    Re: Find all cells with value in column and replace !

    Thank you verry much both of you, that was pretty easy

    Petter

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,099

    Re: Find all cells with value in column and replace !

    You're welcome. Thanks for the rep.

    that was pretty easy
    When you know how ...

+ Reply to 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