View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
justme justme is offline
external usenet poster
 
Posts: 68
Default Need help with code debug please

Public Sub FixASTBs()

Dim wsC As Worksheet
Dim r As Long
Dim myRange As Range

Set wsC = Sheets("Sheet1")

wsC.Activate
Range("E1").Select
Set myRange = wsC.UsedRange
r = ActiveCell.Row
If myRange("E" & r) = [*"ast"*] Then myRange("E" & r).Value = "ASTB" And
myRange("F" & r).Value = "AST"
r = r + 1
Set wsC = Nothing
End Sub

I need to find any cell in column E that contains the letters "ast" (whole
or part of cell). If this is true, I need to replace the whole cell's
contents with "ASTB", and also replace the contents of Column F with "AST"

Debug brings me to "If my Range..." line

Thanks!