Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
connecting 2 inputboxes and using the autofill
What I am trying to do is use the data entered in one inputbox with the data
entered from a 2nd input box. I an trying to make a macro so that the user can make consecutively numbered labels with the push of a button, so the button would bring up the 1st inputbox asking what number to start at and then a 2nd inputbox would appear asking how many to make (how far down the list to go). I can get the 2 inputboxes to pop up and I can get the boxes to dump the numbers into a sheet. I know you can use the autofill function but I am not sure how to connect them all so that the user can just enter the 2 numbers and the macro will fill to the appropriate number. Any help would be great! Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
connecting 2 inputboxes and using the autofill
Perhaps this pseudo code will give you some idea
a = Inputbox ' start number b = Inputbox ' number of cells to "fill" a1 = a for i = 1 to b activecell.Offset(i-0,1).Value = a1 a1 = a1 + 1 Next -- Regards, Tom Ogilvy "Mike" wrote: What I am trying to do is use the data entered in one inputbox with the data entered from a 2nd input box. I an trying to make a macro so that the user can make consecutively numbered labels with the push of a button, so the button would bring up the 1st inputbox asking what number to start at and then a 2nd inputbox would appear asking how many to make (how far down the list to go). I can get the 2 inputboxes to pop up and I can get the boxes to dump the numbers into a sheet. I know you can use the autofill function but I am not sure how to connect them all so that the user can just enter the 2 numbers and the macro will fill to the appropriate number. Any help would be great! Thanks |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
connecting 2 inputboxes and using the autofill
That worked Great! Thanks so much...I am just playing around with it now to
figure out why the list comes up offset but I think that I should be able to figure that one out. Thanks again! "Tom Ogilvy" wrote: Perhaps this pseudo code will give you some idea a = Inputbox ' start number b = Inputbox ' number of cells to "fill" a1 = a for i = 1 to b activecell.Offset(i-0,1).Value = a1 a1 = a1 + 1 Next -- Regards, Tom Ogilvy "Mike" wrote: What I am trying to do is use the data entered in one inputbox with the data entered from a 2nd input box. I an trying to make a macro so that the user can make consecutively numbered labels with the push of a button, so the button would bring up the 1st inputbox asking what number to start at and then a 2nd inputbox would appear asking how many to make (how far down the list to go). I can get the 2 inputboxes to pop up and I can get the boxes to dump the numbers into a sheet. I know you can use the autofill function but I am not sure how to connect them all so that the user can just enter the 2 numbers and the macro will fill to the appropriate number. Any help would be great! Thanks |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
connecting 2 inputboxes and using the autofill
Looks like tangled fingers on my part
activecell.Offset(i-0,1).Value = a1 should be activecell.Offset(i-1,0).Value = a1 -- Regards, Tom Ogilvy "Mike" wrote: That worked Great! Thanks so much...I am just playing around with it now to figure out why the list comes up offset but I think that I should be able to figure that one out. Thanks again! "Tom Ogilvy" wrote: Perhaps this pseudo code will give you some idea a = Inputbox ' start number b = Inputbox ' number of cells to "fill" a1 = a for i = 1 to b activecell.Offset(i-0,1).Value = a1 a1 = a1 + 1 Next -- Regards, Tom Ogilvy "Mike" wrote: What I am trying to do is use the data entered in one inputbox with the data entered from a 2nd input box. I an trying to make a macro so that the user can make consecutively numbered labels with the push of a button, so the button would bring up the 1st inputbox asking what number to start at and then a 2nd inputbox would appear asking how many to make (how far down the list to go). I can get the 2 inputboxes to pop up and I can get the boxes to dump the numbers into a sheet. I know you can use the autofill function but I am not sure how to connect them all so that the user can just enter the 2 numbers and the macro will fill to the appropriate number. Any help would be great! Thanks |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
connecting 2 inputboxes and using the autofill
Thanks!!
"Tom Ogilvy" wrote: Looks like tangled fingers on my part activecell.Offset(i-0,1).Value = a1 should be activecell.Offset(i-1,0).Value = a1 -- Regards, Tom Ogilvy "Mike" wrote: That worked Great! Thanks so much...I am just playing around with it now to figure out why the list comes up offset but I think that I should be able to figure that one out. Thanks again! "Tom Ogilvy" wrote: Perhaps this pseudo code will give you some idea a = Inputbox ' start number b = Inputbox ' number of cells to "fill" a1 = a for i = 1 to b activecell.Offset(i-0,1).Value = a1 a1 = a1 + 1 Next -- Regards, Tom Ogilvy "Mike" wrote: What I am trying to do is use the data entered in one inputbox with the data entered from a 2nd input box. I an trying to make a macro so that the user can make consecutively numbered labels with the push of a button, so the button would bring up the 1st inputbox asking what number to start at and then a 2nd inputbox would appear asking how many to make (how far down the list to go). I can get the 2 inputboxes to pop up and I can get the boxes to dump the numbers into a sheet. I know you can use the autofill function but I am not sure how to connect them all so that the user can just enter the 2 numbers and the macro will fill to the appropriate number. Any help would be great! Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Positioning Userforms, InputBoxes | Excel Discussion (Misc queries) | |||
InputBoxes | Excel Programming | |||
Autofill: Need to autofill one week block, (5) weekday only into cells. | Excel Discussion (Misc queries) | |||
Q. Autofill question: Can I autofill alpha characters like I can numbers? | Excel Programming | |||
InputBoxes Exceptions | Excel Programming |