Question: I am trying to loop through a range in column A and delete each row where the value in cell A starts with a letter (e.g. delete C159, but not 8T9G3). I think the code may work correctly, if I get the between piece straight. Any suggestions how I can get the code to work? 

```
Sub DeleteLetterRows()

Dim k as integer

For k = 2 To 100
    If Asc(ActiveSheet.Range("A" & k).value) >=65 and <=90 or >=97 and <=122
        Rows(k).EntireRow.Delete
    Else
    End If
Next k

End Sub

```

Thanks!

Answer: 
You could do it via a like-join against a list of the terms to exclude :

```

data words ;
  input word $char16. ;
datalines ;
INELIGABLE
REFUSED
;
run ;

proc sql ;
  create table exclude as
  select a.*
  from data_set a
       left join
       words b on upcase(a.comment) like cats('%',b.word,'%')
  where missing(b.word) ;
quit ;

```
Here is another solution, using `contains`, where the search terms comes from a dataset (which can e.g. be read from external file). I like this for its portability.

```
Proc sql noprint;
      select 'Upcase(Comment) contains '''||strip(Upcase(term))||''''
      into :strings separated by ' or '
      from exclusion_terms
      order by 1;

      create table Excluded as
      select *
      from Data_set
      where &strings;
Quit;

```

Here, the first section creates the macro variable `string` from the dataset of exclusion terms, which is then used to create the Excluded dataset.

The hard-coded version version of search terms using `Contains`:

```
Proc Sql;
      create table Excluded as
      select *
      from Data_set
      where Upcase(Comment) contains ('INELIGIBLE' OR 'REFUSED');
Quit;

```