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 |
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 |
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 |
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 |
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 |
All times are GMT +1. The time now is 02:47 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com