Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 67
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Source Data Mess Karen Charts and Charting in Excel 1 June 22nd 07 05:49 AM
Is Excel is now going out of it's way to mess me around? Willot[_3_] Excel Programming 3 June 8th 06 01:14 AM
Crl-Ed : another way to mess-up and fix Patricia Shannon Excel Discussion (Misc queries) 0 March 23rd 06 06:39 PM
Data Range Mess Karen Charts and Charting in Excel 18 January 14th 06 02:34 PM
trying to add a complicated mess to my worksheet... :) hakkabuff Excel Worksheet Functions 3 April 19th 05 12:16 AM


All times are GMT +1. The time now is 05:59 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"