Code - What's Wrong ?

sidzega

New Member
Joined
Jan 22, 2013
Messages
3
Sub Button4_Click()


Dim n As Integer


n = Range("M4").Select


Call LaunchWEST("abx.Ins:& n &", "0", "")

OK so the range is an integer with SIX to Seven Digits and I want it the button to take this string from a Cell and Launch a function LaunchWEST, when the string is selected and completed the button should run:

LaunchWEST("abx.Ins:4879521", "0", "")

I am clueless here peeps.
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
n = Range("M4").Select

should be

n = Range("M4").Value

if you are trying to get the value that is in cell M4.
 
Upvote 0
Sub Button4_Click()


Dim n As Long






n = Range("M4").Text










Call LaunchWEST("abx.Ins:" & n & "", "0", "")


This is working perfectly :)

THank you people
 
Upvote 0
OK, obviously there were a few things I missed. Texaslynn's suggestion is also necessary as well as changing

Dim n as Long
Integers can only be numbers from -32,767 to +32,767


EDIT: NM, I see you got it. Glad it is working.
 
Upvote 0

Forum statistics

Threads
1,215,267
Messages
6,123,964
Members
449,137
Latest member
yeti1016

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