Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Why does VBA mess up
Why is it that when I try to run my code sometime it works other times
it does not. I have tried to run the whole thing or one section at a time. there have been times when I run maybe the first few lines and it doesn't work. Then I close excel re-open and still it won't work. Then I try it again and it works. This only started to happen when I went to adjust some of my code. All I added was strTextToFind = "Pre" <----------- I have this change arrText = Split(strTextToFind, ";") Set rngFind = Range("A1:A1000") On Error Resume Next For x = 0 To UBound(arrText) rngFind.Cells(1, 1).Activate Do Until Err.Number = 91 rngFind.Find(What:=arrText(x), after:=ActiveCell.Offset(1, 0), LookIn:=xlValues).Activate If Err.Number = 0 Then ActiveCell.EntireRow.Delete End If Loop Err.Clear Next x On Error GoTo 0 However, I already have three of the same exact lines other than the first line because it looks for that work then deletes that cell. I don't understand what is happening. Please help. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Source Data Mess | Charts and Charting in Excel | |||
Is Excel is now going out of it's way to mess me around? | Excel Programming | |||
Crl-Ed : another way to mess-up and fix | Excel Discussion (Misc queries) | |||
Data Range Mess | Charts and Charting in Excel | |||
trying to add a complicated mess to my worksheet... :) | Excel Worksheet Functions |