Advice to call a code

ipbr21054

Well-known Member
Joined
Nov 16, 2010
Messages
5,226
Office Version
  1. 2007
Platform
  1. Windows
Hi,

I have a msgbox where No closes it but i would like when Yes is clicked it will Call say the below to run it


VBA Code:
Private Sub DHLBUTTON_Click()
ActiveWorkbook.FollowHyperlink Address:="http://www.dhl.co.uk/en/express/tracking.html", NewWindow:=True
End Sub

can you advise the correct way to wright it please
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
If its easier for you.
The customers name is also selected in column A
Then the userform DATABASE opens.

So remember the selection in Column A & use that to select from the comboBox ?
Haven't used UserForms in a while, so I'm a bit sketchy, but in principle you just need to declare another variable to "remember" the selected value from the ListBox, and then make the value of the ComboBox equal to that value stored in that variable
 
Upvote 0
ok thanks.

Ive started to try with this.

VBA Code:
Private Sub ListBox1_Click()
  Dim answer As Integer

  Range("A" & ListBox1.List(ListBox1.ListIndex, 1)).Select
  answer = MsgBox("OPEN DATABASE ?", vbYesNo + vbCritical, "OPEN DATABASE MESSAGE")
   If answer = vbYes Then
   Unload DatabaseNameSearch
   If ListBox1.Value = True Then
   Database.Show
   ComboBox1.Value = ListBox1.Value.Select
  
    Else
    Unload DatabaseNameSearch

If anybody could advise please.
    End If
End Sub
 
Upvote 0
I havent progressed any more since my last post.
I am able to select a customer from the listbox which then closes leaving that customer selected on my worksheet.
The code i have which is a double click code does what i require BUT the code cant double click so another alternative to run the double click code needs to be addressed.

Then im done as its completed.
 
Upvote 0
I'm really sorry, I just can't understand what you're saying. I don't think you're asking anything about a userform or listbox any more, I think you want something to happen when you double click a cell on a worksheet. Can you explain in another way so I can help?
 
Upvote 0
My goal is to open the customer that was selected in the ListBox1 on the userform called Database.
That is my goal.

What i am saying is if i double click the name in column A then the userform opens & that name i double clicked is now in front of me.
This is an example of whats happens.

So,
The userform opens.
I partial type a name is the search field.
All customers that partial match are now shown in the listbox
I then select the correct customer.
The userform closes & that customer is now currently selected in column A

THIS IS WHERE IT STOPS.

So what im saying is we need to have the customer in this active cell open up the userform DATABASE & there record then be shown.

How about that ?
 
Upvote 0

Forum statistics

Threads
1,214,632
Messages
6,120,655
Members
448,975
Latest member
sweeberry

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