LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 201
Default Macro Random Behavior

Excel 2003, WinXP
I have been battling this one all day, trying to find a pattern to the
behavior of this macro. I can't. It appears to be completely random.
I have two sheets.
I take all of the Column F data from each sheet and formulate a list. That
list is in the Data Validation [D32] in the Enter Data sheet.
I select one item in D32. That item now remains constant.
The following macro simply searches the two sheets from which the list was
taken, for [D32] of the Enter Data sheet.
The problem: Sometimes it finds the item. Sometimes it doesn't.
I have tried every which way to find a pattern in the macro behavior but
couldn't. Sometimes it finds it in alternating executions of the macro.
Other times it doesn't. The error highlight is, of course, in the MsgBox
line.
Does anyone have an idea of what I am doing wrong? Thanks for your help.
Otto
Sub Test()
Dim FoundCell As Range
SearchPart = Sheets("Enter Data").Range("D32").Value
Sheets(Array("Air Compressor", "Bay Door")).Select
Set FoundCell = Selection.Find(What:=SearchPart, _
After:=Selection(1), LookIn:=xlValues, _
LookAt:=xlWhole, SearchOrder:=xlByColumns, _
SearchDirection:=xlNext, MatchCase:=True)
MsgBox FoundCell.Row
Sheets("Enter Data").Select
[D32].Select
End Sub


 
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
weird macro behavior Dave F Excel Discussion (Misc queries) 0 November 30th 06 03:35 PM
Inconsistent Macro Behavior Sarah K Excel Discussion (Misc queries) 4 November 1st 05 10:36 PM
Strange Personal Macro Workbook Behavior stretch Excel Discussion (Misc queries) 4 August 4th 05 07:39 PM
Weird template/macro behavior ?? David Excel Programming 0 August 12th 03 04:33 PM
Weird template/macro behavior ?? Tom Ogilvy Excel Programming 0 August 12th 03 04:17 PM


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

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

About Us

"It's about Microsoft Excel"