Macro Help!

xxcucumberxx

New Member
Joined
Feb 23, 2016
Messages
7
i have a macro that does what i need it to do but it does it to one number at a time. Is there a way i can update it so i could put a list of numbers have have it do the process to each number? Please help



Sub ZMain()
Dim Text, ret
SendHostKeys ("<TAB>")
SendHostKeys ("<TAB>")
SendHostKeys ("<TAB>")
SendHostKeys ("<TAB>")
SendHostKeys ("123456789<UP>")
SendHostKeys ("<LEFT>")
SendHostKeys ("<LEFT>")
SendHostKeys ("<LEFT>")
SendHostKeys ("<LEFT>")
SendHostKeys ("<LEFT>")
SendHostKeys ("<LEFT>")
SendHostKeys ("<LEFT>")
SendHostKeys ("<LEFT>")
SendHostKeys ("<LEFT>")
SendHostKeys ("<LEFT>")
SendHostKeys ("<LEFT>")
SendHostKeys ("<LEFT>")
SendHostKeys ("<LEFT>")
SendHostKeys ("<LEFT>")
SendHostKeys ("<LEFT>")
SendHostKeys ("<LEFT>")
SendHostKeys ("t<ENTER>")
ret = WaitForHostUpdate(10)
SendHostKeys ("<TAB>")
SendHostKeys ("<TAB>")
SendHostKeys ("<TAB>")
SendHostKeys ("<TAB>")
SendHostKeys ("<TAB>")
SendHostKeys ("030116te<ENTER>")
ret = WaitForHostUpdate(10)
SendHostKeys ("<PF1>")
ret = WaitForHostUpdate(10)
SendHostKeys ("b<ENTER>")
ret = WaitForHostUpdate(10)
End Sub






Thank you who helped. The number that i replace is the 123456789 and it does its process but them i need to go in and replace that number with my next one and do it again. i want to put multiple numbers and have it do the steps to each one.
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.

Forum statistics

Threads
1,216,075
Messages
6,128,668
Members
449,463
Latest member
Jojomen56

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