Find Call procedure code within module list

ipbr21054

Well-known Member
Joined
Nov 16, 2010
Messages
5,832
Office Version
  1. 2007
Platform
  1. Windows
I wish to find where the code is for Call procedures.

For these Example.

@RoryA I did look through some old posts but didnt find what you advised.
Something like but isnt Shift Control F5 etc etc,please advise again & this time i will make a note of it Thanks


VBA Code:
Private Sub UserForm_Initialize()
Application.ScreenUpdating = False
On Error GoTo End_here
Call add_val("LOST")
Call add_val("DELIVERED NO SIG")
Call add_val("RETURNED")
Call add_val("UNKNOWN")
End_here: Application.ScreenUpdating = True
End Sub
 
add_val takes one text argument. It then looks for that text in columns A:G on the Postage sheet and if found, adds the row data to Listbox1. (it seems badly coded to me as it searches 7 columns but uses a fixed offset to return data from that found row, so you could end up with all sorts of data and/or errors)

That code calls the same function 4 times, searching for a different value each time. I have no idea what you think the connection to Module51 is.
 
Upvote 0

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Module 51 is just where the arrow was pointing.
I was just refering to the Modules in question.

The code should just look in column G as that is where the below is.
LOST, DELIVERED NO SIG, RETURNED, UNKNOWN
 
Upvote 0
If you put the cursor in the word add_val and press Shift+f2 it should take you to wherever the add_val function code is.
 
Upvote 0
It takes me to the procedure mentioned above BUT looking in that code who does it now what to look for ?
So see my issue or what im on about
 
Upvote 0
Like I said, it looks for whatever value was passed to it when it was called.
 
Upvote 0
See if this helps:

1734009269790.png
 
Upvote 0
Not sure what that is telling me but i was looking for the code in the Call as advised to see if the issue with date in listbox was there.
You advice solved the issue so basically that then ends this post.

Thanks
 
Upvote 0
What Alex was showing you is that each time you call the add_val function, the text you pass ("LOST", "RETURNED" etc) is represented by the variable A in the code. So in your first call above, A has the value "LOST"; in the second call it has the value "DELIVERED NO SIG" and so on.
 
Upvote 0
What Alex was showing you is that each time you call the add_val function, the text you pass ("LOST", "RETURNED" etc) is represented by the variable A in the code. So in your first call above, A has the value "LOST"; in the second call it has the value "DELIVERED NO SIG" and so on.
OK i now understand that but still lost when you said its checking 7 columns.
In the code it shows G so i thought it is only looking in column G so confused when you said 7
 
Upvote 0
Your range to search (r in the code) goes from A2183 to the last row in column G.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top