Hi ALL,
I posed this question yesterday and thought that it was resolved, however, the solution opened the door to new problems.
My project incorporates about a half dozen or more columns (each column with at least 240 rows) which run a macro using the find method when the user double-clicks a cell.
Currently, I'm running this code:
>>>>>>>>>>>>>>>>>>>>>
IPrivate Sub Worksheet_BeforeDoubleClick( _
ByVal target As Excel.Range, _
Cancel As Boolean)
Dim addr As String
addr = target.Address
If addr = "$A$13" Then
End If
If addr = "$A$14" Then
End If
If addr = "$A$15" Then
End If
and so on................
End Sub
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
and it works spendidly. The problem with this code is that it includes a reference for each cell where I want this "Double-Click" event to occur, thus it uses too much memory.
I recently experimented with variations of this code that would be more efficient and reduced the amount of memory required to run the procedure. The code included the following:
code:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>CaIPrivate Sub Worksheet_BeforeDoubleClick( _
ByVal target As Excel.Range, _
Cancel As Boolean)
Dim addr As String
addr = target.Address
If addr >= "$A$13" and addr <= "$A$100" Then
Call 'FindRoutine'
End If
End Sub
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
The above code produces inconsistent results, sometimes it works and other times not at all.
I also tried the following and at first I thought I had my problem resolved, but then I notice that while my routine would work in column "A", it would work before cell "$A$13" even though my control statement clearly defines the range where it should be activate.
code:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Private Sub Worksheet_BeforeDoubleClick( _
ByVal target As Excel.Range, _
Cancel As Boolean)
Dim addr As String
addr = target.Address
Select Case addr
case "$A$13" To "$A$100"
Call 'FindRoutine'
End Select End Sub
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Furthermore, I have tried to define my range with:
Case Is >="$A$13"
again the results are inconsistent.
Any help onthis will be greatly appreciated.
Chris