Net Send to Many by macro

T

Tazflerts

Hello All,

I am trying to send network notifications from a selection in Excel 2003

net send B1F4CU35 Please remember business casual Wednesday, Thursday and
Friday..
net send B1F4CU045 Please remember business casual Wednesday, Thursday and
Friday..
net send B1F4CU31 Please remember business casual Wednesday, Thursday and
Friday..
net send B1F4CU39 Please remember business casual Wednesday, Thursday and
Friday..

This version leaves the cmd window open


or


s: && cd \time sheet\wfm\net send\to agents\2009\ && net send B1F4CU040
Please exit after call work! >> 20091103agents.txt && exit
s: && cd \time sheet\wfm\net send\to agents\2009\ && net send B1F4CU25
Please exit after call work! >> 20091103agents.txt && exit
s: && cd \time sheet\wfm\net send\to agents\2009\ && net send B1F4CU19
Please exit after call work! >> 20091103agents.txt && exit
s: && cd \time sheet\wfm\net send\to agents\2009\ && net send BiF4CU20
Please exit after call work! >> 20091103agents.txt && exit


This version writes the conclusion to a file and thex exits the cmd window.


The method of sending the selection is from a macro attached to a command
button in the worksheet.


The Macro is

Sub NetSend()

Shell "cmd.exe /k" & ActiveCell, vbNormalFocus

End Sub


This works fine when a single cell is selected and you click on the command
button.

However it only runs the first line when a number of cells is selected.

How can I have this be able to send to selective cells select (A1, A5, A8,
A20) or continuous cell selection?

Thanks,
Kevin
 
J

Jim Thomlinson

Sub NetSend()
dim rng as range

for each rng in selection
Shell "cmd.exe /k" & rng.value, vbNormalFocus
next rng

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top