VB Macro Question/Changing Pages

Outsider418

New Member
Joined
Jul 20, 2011
Messages
2
Good Morning.

I am very new to VB so please bear with me.

On my job, I can make/record simple macros to use on our scratchpads. I found that I can modify these macros after I record them. The only problem that I have is that if I have a macro that records three lines of text and I only have space for two, the third line starts again at the top. What command do I use to make the macro change pages once I run out of space on the page that I'm on?

Thanks for your help!
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
I am not following..

Can you paste your recorded macro here and explain what you are trying to accomplish with it?
 
Upvote 0
Sorry about that...I should have posted an example.

I made a quick macro...I tested it and it works on my system at work.

Sub ZMain()
Dim Text, ret
SendHostKeys ("A409This is the first line of the macro<tab>R<Tab>")
SendHostKeys ("This is the second line of the macro<Tab>R<Tab>")
SendHostKeys ("This is the third line of the macro")
End Sub

This macro is 3 lines long. If I'm on the scratchpad and there are only two lines left, the third line will end up at the top of the page I am on instead of switching to the next page. Is there a command that I can put in that tells the macro to change pages if it runs out of space?

Thanks for your help.
 
Upvote 0

Forum statistics

Threads
1,224,613
Messages
6,179,903
Members
452,948
Latest member
Dupuhini

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