Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB and Excel - SMS text messaging 2

Status
Not open for further replies.

Woodyuk

IS-IT--Management
Aug 22, 2003
59
GB
Im trying to publish some figures as a text message to mobile phone users.
Some one has sorted this out the text messaging side for me, with something that runs in a macro.
The problem I have is in this macro, the message it sends has to be put in ". What every i type in these " will then be sent, how ever this is in VB and i want it to look at a cell in the excell sheet, and send the text in that.
This is an example of how the SMS is sent, in the macro:
SendSMS("UserName", "Password", "Phone Number", "Message")

Now where it says message, i want that to look at sheet1 cell C7. This is where im stuck as I cant seem to type in a lookup there, and also if i put in " it sends what ever is typed into it.

Can anyone help?!?!?!?!?!?!?
 
It looks like the macro is calling a function (SendSMS) which has 4 variables passed to it. If that's the case, then instead of passing "Sheet1..." or whatever you're trying to pass, you could actually call another function to get this value. So your SendSMS would become something like:

SendSMS("Username", "Password", "PhoneNumber", GetTheMessage)

Then in a module you'd create a function called "GetTheMessage" that would return the value from Excel.

Hope that makes sense...and I'm not talking over your head (or under for that matter).

Kevin
 
I'm assuming this is similar to email functions I use in VBA.... Try this:
Code:
...
[COLOR=red]strMsg[/color] = Range("sheet1!$c$7")
SendSMS("UserName", "Password", "Phone Number", [COLOR=red]strMsg[/color])
...
Hope that helps.
John

[tt]-John[/tt]
________________________
To get the best answers fast, please read faq181-2886
 
John thats briilaint works superb. Kevin im sure you were suggesting the same way
 
Glad to help!
[cheers]

[tt]-John[/tt]
________________________
To get the best answers fast, please read faq181-2886
 
Yes, only problem i have now is the cell im looking at has a vlookup in it, and it doesnt seem to like this. With text typed in on its own it seems to be fine.
So im almost there
 
Try changing it to this:
strMsg = Range("sheet1!$c$7").Value


[tt]-John[/tt]
________________________
To get the best answers fast, please read faq181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top