Help making buttons that move data & call external programs

Microsoft Excel 2010 - complete product...
January 26, 2012 at 08:52:12
Specs: Windows XP
I need help with a few buttons.

First my data

A        B        C    D     E   F
company1 address1 city state zip phone#
company2 address1 city state zip phone#
company3 address1 city state zip phone#

I will have the phone number selected and moving down col F using arrow keys.

The first button I need would call a batch file with a var of the data in the selected phone# in col F.

The second button I would need to move the whole row to another sheet and remove the empty line.

Thank you for your time and help.


See More: Help making buttons that move data & call external programs

Report •


#1
January 26, 2012 at 11:22:32
Ok found the fix for calling the external program. May be sloopy but it works...

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)

If Target.Column = 6 Then
 Shell "c:\test.bat " & ActiveSheet.Cells(Target.Row, 6)
 
End If
 
End Sub

put this in the worksheet code.

Test.bat reads

set area=%1
set code=%area:~1,3%
set pre=%2
set numb=%2
set pre2=%pre:~0,3%
set numb2=%numb:~4,4%
"C:\PFILES\DIAL ENGINE PRO\DIAL.EXE" 1%code%%pre2%%numb2% 

Using free software was able to make it dial when double click on the number.


Report •

#2
January 26, 2012 at 16:41:14
Can someone help me with a macro button that will cut and paste the row that the selected field (Col. F/the number) to another sheet.

Report •

Related Solutions


Ask Question