Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Positioning Userforms, InputBoxes Pflugs Excel Discussion (Misc queries) 1 July 10th 07 06:12 PM
InputBoxes Sean Excel Programming 2 July 19th 06 06:09 PM
Autofill: Need to autofill one week block, (5) weekday only into cells. dstock Excel Discussion (Misc queries) 1 June 17th 05 08:21 PM
Q. Autofill question: Can I autofill alpha characters like I can numbers? George[_22_] Excel Programming 5 August 7th 04 10:33 AM
InputBoxes Exceptions ianripping[_42_] Excel Programming 3 April 8th 04 09:34 PM


All times are GMT +1. The time now is 10:39 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"