Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 343
Default Problem running code in proper order

My problem is that the code:

Call FindLastNoXXX.FindLastNoXXX

does not seem to complete before the UserForm displays. The FindLastNoXXX
code needs to place a value in Cell AA5 prior to the UserForm opening. Any
ideas?

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)

Dim rng
Set rng = Cells(ActiveCell.Row, 1)

If rng(1, 2).Value = "" Then
Application.EnableEvents = False
GoTo Finished

End If

If Not Application.Intersect(Target, Range("C7:V700")) Is Nothing Then
'NoShowDataInput.Show

Call FindLastNoXXX.FindLastNoXXX

NoShowDataInput.Show

End If

Finished:

End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default Problem running code in proper order

This line confuses me:

Call FindLastNoXXX.FindLastNoXXX

Maybe:

Call FindLastNoXXX



"Patrick C. Simonds" wrote in message
...
My problem is that the code:

Call FindLastNoXXX.FindLastNoXXX

does not seem to complete before the UserForm displays. The FindLastNoXXX
code needs to place a value in Cell AA5 prior to the UserForm opening. Any
ideas?

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)

Dim rng
Set rng = Cells(ActiveCell.Row, 1)

If rng(1, 2).Value = "" Then
Application.EnableEvents = False
GoTo Finished

End If

If Not Application.Intersect(Target, Range("C7:V700")) Is Nothing Then
'NoShowDataInput.Show

Call FindLastNoXXX.FindLastNoXXX

NoShowDataInput.Show

End If

Finished:

End Sub



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Problem running code in proper order

It's a very bad idea to have modules and procedures share the same name.

I don't know if that's the cause of your problem, but I change the name of one
of those.


"Patrick C. Simonds" wrote:

My problem is that the code:

Call FindLastNoXXX.FindLastNoXXX

does not seem to complete before the UserForm displays. The FindLastNoXXX
code needs to place a value in Cell AA5 prior to the UserForm opening. Any
ideas?

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)

Dim rng
Set rng = Cells(ActiveCell.Row, 1)

If rng(1, 2).Value = "" Then
Application.EnableEvents = False
GoTo Finished

End If

If Not Application.Intersect(Target, Range("C7:V700")) Is Nothing Then
'NoShowDataInput.Show

Call FindLastNoXXX.FindLastNoXXX

NoShowDataInput.Show

End If

Finished:

End Sub


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Problem running code in proper order

ps. Maybe the code in that FindLastNoXXX is not doing what you expect. You may
want to share that.

"Patrick C. Simonds" wrote:

My problem is that the code:

Call FindLastNoXXX.FindLastNoXXX

does not seem to complete before the UserForm displays. The FindLastNoXXX
code needs to place a value in Cell AA5 prior to the UserForm opening. Any
ideas?

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)

Dim rng
Set rng = Cells(ActiveCell.Row, 1)

If rng(1, 2).Value = "" Then
Application.EnableEvents = False
GoTo Finished

End If

If Not Application.Intersect(Target, Range("C7:V700")) Is Nothing Then
'NoShowDataInput.Show

Call FindLastNoXXX.FindLastNoXXX

NoShowDataInput.Show

End If

Finished:

End Sub


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 343
Default Problem running code in proper order

Thank you for your time. I named the module the same just for the ability to
find what I am looking for more quickly, but as a buffer, I will take your
advice to heart. Just wondering what the danger of using the same name might
be.

As to my original problem. I have solved that one. Out of 50,172 characters
I missed typed 1 number. It took almost 5 hours to track that down.

"Dave Peterson" wrote in message
...
ps. Maybe the code in that FindLastNoXXX is not doing what you expect.
You may
want to share that.

"Patrick C. Simonds" wrote:

My problem is that the code:

Call FindLastNoXXX.FindLastNoXXX

does not seem to complete before the UserForm displays. The FindLastNoXXX
code needs to place a value in Cell AA5 prior to the UserForm opening.
Any
ideas?

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)

Dim rng
Set rng = Cells(ActiveCell.Row, 1)

If rng(1, 2).Value = "" Then
Application.EnableEvents = False
GoTo Finished

End If

If Not Application.Intersect(Target, Range("C7:V700")) Is Nothing Then
'NoShowDataInput.Show

Call FindLastNoXXX.FindLastNoXXX

NoShowDataInput.Show

End If

Finished:

End Sub


--

Dave Peterson


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
problem running code DDD Excel Programming 9 January 27th 09 06:58 AM
Problem with code to print - out of order Steph[_6_] Excel Programming 0 February 2nd 06 04:00 PM
proper syntax order Roberta H via OfficeKB.com Excel Worksheet Functions 2 January 18th 06 10:14 PM
Code running order Santiago[_3_] Excel Programming 2 September 15th 05 02:06 PM
Tab Order Code Problem Ryan Excel Programming 3 April 19th 04 05:01 PM


All times are GMT +1. The time now is 03:17 AM.

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"