+ Reply to Thread
Results 1 to 3 of 3

Code to replace null and not null strings

  1. #1
    Registered User
    Join Date
    05-04-2008
    Posts
    43

    Code to replace null and not null strings

    I've got two coding problems:

    Firstly, I am trying to replace a range of empty cells with text. This works (Sub ta2()), but not if I do this on line 4:
    Please Login or Register  to view this content.
    Does anyone know why? I don't see why I have to reenter the range when the variable has been initialised.


    Please Login or Register  to view this content.
    Additionally, I have a range of cells, some are marked as 'X' and I would like these replaced by a string 'Replace1'. Those which are null/empty, I would like to replace with 'Replace2'. I have tried the code below but it isn't working (i.e. just replaces everything with 'Replace2'). Any suggestions?
    Thanks, Tim

    Please Login or Register  to view this content.

  2. #2
    Forum Contributor
    Join Date
    06-03-2008
    Posts
    387
    The code below will go through each individual cell, so you can test the values.

    Please Login or Register  to view this content.
    Last edited by yawnzzzz; 08-25-2008 at 10:51 AM.

  3. #3
    Registered User
    Join Date
    05-04-2008
    Posts
    43

    Code to replace null and not null strings

    Many Thanks - you have made it so easy. I was hoping to learn the hard way...

+ 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