Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do you create a macro to auto number in excel 2003
I would like to have excel auto number a new work sheet every time I print a
new sheet. The form that I have created has the page numbers in cell I3 and only has to number from 7 to infinity. -- Matt |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do you create a macro to auto number in excel 2003
I'd create a dedicated macro and then put a button from the Forms toolbar onto
that sheet and assign the macro to this button. Option Explicit sub PrintMe() with activesheet if isnumeric(.range("I3").value) then .range("I3").value = .range("I3").value + 1 .printout preview:=true else Beep msgbox "I3 isn't a number!" end if end with end sub mceder1 wrote: I would like to have excel auto number a new work sheet every time I print a new sheet. The form that I have created has the page numbers in cell I3 and only has to number from 7 to infinity. -- Matt -- Dave Peterson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do you create a macro to auto number in excel 2003
Dave
I created a button and copied your code from below. I guess that I dont know how to put the button on the workbook. -- Matt "Dave Peterson" wrote: I'd create a dedicated macro and then put a button from the Forms toolbar onto that sheet and assign the macro to this button. Option Explicit sub PrintMe() with activesheet if isnumeric(.range("I3").value) then .range("I3").value = .range("I3").value + 1 .printout preview:=true else Beep msgbox "I3 isn't a number!" end if end with end sub mceder1 wrote: I would like to have excel auto number a new work sheet every time I print a new sheet. The form that I have created has the page numbers in cell I3 and only has to number from 7 to infinity. -- Matt -- Dave Peterson |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do you create a macro to auto number in excel 2003
Put the code in a general module--not behind the worksheet and not behind the
ThisWorkbook module. Then show the Forms toolbar. Plop a button from that toolbar onto the worksheet. You'll be prompted to assign the macro--choose this macro. If you have a button from the Forms toolbar already on the worksheet, you can rightclick on it and choose Assign Macro. Remember that this is the button from the Forms toolbar--not the commandbutton from the Control toolbox toolbar. mceder1 wrote: Dave I created a button and copied your code from below. I guess that I dont know how to put the button on the workbook. -- Matt "Dave Peterson" wrote: I'd create a dedicated macro and then put a button from the Forms toolbar onto that sheet and assign the macro to this button. Option Explicit sub PrintMe() with activesheet if isnumeric(.range("I3").value) then .range("I3").value = .range("I3").value + 1 .printout preview:=true else Beep msgbox "I3 isn't a number!" end if end with end sub mceder1 wrote: I would like to have excel auto number a new work sheet every time I print a new sheet. The form that I have created has the page numbers in cell I3 and only has to number from 7 to infinity. -- Matt -- Dave Peterson -- Dave Peterson |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do you create a macro to auto number in excel 2003
-- I donot get a assign macro command. I may not be getting to the right forms command. I am new to macros if you couldnt tell Matt "Dave Peterson" wrote: Put the code in a general module--not behind the worksheet and not behind the ThisWorkbook module. Then show the Forms toolbar. Plop a button from that toolbar onto the worksheet. You'll be prompted to assign the macro--choose this macro. If you have a button from the Forms toolbar already on the worksheet, you can rightclick on it and choose Assign Macro. Remember that this is the button from the Forms toolbar--not the commandbutton from the Control toolbox toolbar. mceder1 wrote: Dave I created a button and copied your code from below. I guess that I dont know how to put the button on the workbook. -- Matt "Dave Peterson" wrote: I'd create a dedicated macro and then put a button from the Forms toolbar onto that sheet and assign the macro to this button. Option Explicit sub PrintMe() with activesheet if isnumeric(.range("I3").value) then .range("I3").value = .range("I3").value + 1 .printout preview:=true else Beep msgbox "I3 isn't a number!" end if end with end sub mceder1 wrote: I would like to have excel auto number a new work sheet every time I print a new sheet. The form that I have created has the page numbers in cell I3 and only has to number from 7 to infinity. -- Matt -- Dave Peterson -- Dave Peterson |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do you create a macro to auto number in excel 2003
Delete that button (I think you used the wrong one)
Then View|Toolbars|show the Forms toolbar And use the button from that toolbar. mceder1 wrote: -- I donot get a assign macro command. I may not be getting to the right forms command. I am new to macros if you couldnt tell Matt "Dave Peterson" wrote: Put the code in a general module--not behind the worksheet and not behind the ThisWorkbook module. Then show the Forms toolbar. Plop a button from that toolbar onto the worksheet. You'll be prompted to assign the macro--choose this macro. If you have a button from the Forms toolbar already on the worksheet, you can rightclick on it and choose Assign Macro. Remember that this is the button from the Forms toolbar--not the commandbutton from the Control toolbox toolbar. mceder1 wrote: Dave I created a button and copied your code from below. I guess that I dont know how to put the button on the workbook. -- Matt "Dave Peterson" wrote: I'd create a dedicated macro and then put a button from the Forms toolbar onto that sheet and assign the macro to this button. Option Explicit sub PrintMe() with activesheet if isnumeric(.range("I3").value) then .range("I3").value = .range("I3").value + 1 .printout preview:=true else Beep msgbox "I3 isn't a number!" end if end with end sub mceder1 wrote: I would like to have excel auto number a new work sheet every time I print a new sheet. The form that I have created has the page numbers in cell I3 and only has to number from 7 to infinity. -- Matt -- Dave Peterson -- Dave Peterson -- Dave Peterson |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do you create a macro to auto number in excel 2003
You can use the Visual Basic toolbox and drag drop a button onto the
form. with regards, J.V.Ravichandran - http://www.geocities.com/ jvravichandran - Or, just search on "J.V.Ravichandran" at http://www.Google.com *** Sent via Developersdex http://www.developersdex.com *** |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Auto adding a macro when Excel 2003 opens | Excel Discussion (Misc queries) | |||
Allow Auto Filter Within Macro in Excel 2003 (SP2) | New Users to Excel | |||
Trying to create a macro to auto number blank (excel 2003) | Excel Programming | |||
Create formula which will number a list in Excel 2003 | Excel Discussion (Misc queries) | |||
VBA Excel Macro - One File Auto Create Multiple Excel Worksheets! | Excel Programming |