connecting 2 inputboxes and using the autofill

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 
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!
 
Looks like tangled fingers on my part

activecell.Offset(i-0,1).Value = a1


should be

activecell.Offset(i-1,0).Value = a1
 
Thanks!!

Tom Ogilvy said:
Looks like tangled fingers on my part

activecell.Offset(i-0,1).Value = a1


should be

activecell.Offset(i-1,0).Value = a1
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top