Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
debug code | Excel Discussion (Misc queries) | |||
Debug Error in Code | Excel Discussion (Misc queries) | |||
Excel 2000 Code works except in debug mode | Excel Programming | |||
Code hangs Excel ... Why? ... and how can i debug?? | Excel Programming | |||
debug help | Excel Programming |