Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro Help Please
I need to create a macro that will take a value in cell A1 and add 1 t it, and put the new value back into cell A1, then print the page. I should then add 1 to cell A1 again, putting the new value back int cell A1 and print again. It should repeat this process untill cell A reaches a certain value and then stop. Any help at all would be very appreciated. thank yo -- jespl ----------------------------------------------------------------------- jespl1's Profile: http://www.excelforum.com/member.php...fo&userid=2745 View this thread: http://www.excelforum.com/showthread.php?threadid=46961 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro Help Please
Record a macro where you select A1, add 1 to it, then print the page.
That is the meat of the macro. Around that you will have to use a loop. The easiest for a beginner is probably a For...Next loop Basically in your macro add this line AFTER the line that says PUBLIC Macro1() but before any of the other commmands: For I = 1 to 100 (or however many you want to go) Then add the following line right before the line that says END SUB Next If not, look up a for next loop "jespl1" wrote: I need to create a macro that will take a value in cell A1 and add 1 to it, and put the new value back into cell A1, then print the page. It should then add 1 to cell A1 again, putting the new value back into cell A1 and print again. It should repeat this process untill cell A1 reaches a certain value and then stop. Any help at all would be very appreciated. thank you -- jespl1 ------------------------------------------------------------------------ jespl1's Profile: http://www.excelforum.com/member.php...o&userid=27451 View this thread: http://www.excelforum.com/showthread...hreadid=469610 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro Help Please
Sub IncrementAndPrint()
Dim lngCounter As Long Dim wks As Worksheet Set wks = ActiveSheet For lngCounter = 1 To 5 wks.Range("A1") = wks.Range("A1") + 1 wks.PrintPreview 'Change to wks.Printout Next lngCounter End Sub -- HTH... Jim Thomlinson "jespl1" wrote: I need to create a macro that will take a value in cell A1 and add 1 to it, and put the new value back into cell A1, then print the page. It should then add 1 to cell A1 again, putting the new value back into cell A1 and print again. It should repeat this process untill cell A1 reaches a certain value and then stop. Any help at all would be very appreciated. thank you -- jespl1 ------------------------------------------------------------------------ jespl1's Profile: http://www.excelforum.com/member.php...o&userid=27451 View this thread: http://www.excelforum.com/showthread...hreadid=469610 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro recorded... tabs & file names changed, macro hangs | Excel Worksheet Functions | |||
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort | Excel Worksheet Functions | |||
how to count/sum by function/macro to get the number of record to do copy/paste in macro | Excel Programming | |||
macro to delete entire rows when column A is blank ...a quick macro | Excel Programming | |||
Start Macro / Stop Macro / Restart Macro | Excel Programming |