Need to create macro for other program

jtswanny

New Member
Joined
Mar 19, 2002
Messages
17
I need to add a quote to the beginning of numbers in 2 columns ie 2 becomes "2. and then need to insert the column a1..a50 into the text

[wait app]
"3
=a1
[tab field]
"2
[enter]
[wait app]
=b1
[erase eof]
[enter]
[wait app]
y
[enter]

Then output the whole text to text file. Any ideas...
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Try the following:

Sub OutputFile()
Open "c:iFileName.txt" For Output As #1
Print #1, "[wait app]"
Print #1, """" & "3"
Print #1, "=a1"
Print #1, "[tab field]"
Print #1, """" & "2"
Print #1, "[Enter]"
Print #1, "[wait app]"
Print #1, "=b1"
Print #1, "[erase eof]"
Print #1, "[Enter]"
Print #1, "[wait app]"
Print #1, "y"
Print #1, "[Enter]"
For i = 1 To 50
Print #1, Range("A1").Offset(i - 1, 0).Value
Next i
Close #1
End Sub

Hope it helps
 
Upvote 0

Forum statistics

Threads
1,213,536
Messages
6,114,207
Members
448,554
Latest member
Gleisner2

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