Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
JK JK is offline
external usenet poster
 
Posts: 78
Default Fill-in Range from UserForm

Tom Ogilvy was kind enough to solve this question for me with the following
procedu



I would like UserForm to allow the user to enter 1 wiget and 2 gadgets (for
example) then have my procedure list that information in a range like so:

NO ITEM
1 widget
2 gadget
3 gadget



Dim j as long, i as Long, k as Long

j = 0
for k = 1 to 4 Step 2
for i = 1 to clng(Userform1.controls("Textbox" & k).Text)
j = j + 1
activecell.offset(j-1,1).Value = j
activeCell.offset(j-1,2).Value = _
Userform1.controls("TextBox" & k + 1).Text
Next i
Next k
ActiveCell.offset(j,0).Select



Now I would like to include a TB in the UserForm to collect a price so the
WS range will appear as such:



NO ITEM PRICE
1 widget $1.00
2 gadget $2.00
3 gadget $2.00



Please advise what I must include in the procedure to create. TIA.

Jim Kobzeff

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Fill-in Range from UserForm

if you follow the same pattern so you will have 2 sets of 3 textboxes
sequentially numbered

Textbox1 - quantity
Textbox2 - name
Textbox3 - price


Textbox4 - quantity
Textbox5 - name
Textbox6 - price


Dim j as long, i as Long, k as Long

j = 0
for k = 1 to 6 Step 3
for i = 1 to clng(Userform1.controls("Textbox" & k).Text)
j = j + 1
activecell.offset(j-1,1).Value = j
activeCell.offset(j-1,2).Value = _
Userform1.controls("TextBox" & k + 1).Text
activecell.offset(j-1,3).value = _
Userforms1.controls("TextBox" & k + 2).Text
Next i
Next k
ActiveCell.offset(j,0).Select

--
Regards,
Tom Ogilvy


"JK" wrote in message news:CkFTf.4984$vy.2631@trnddc01...
Tom Ogilvy was kind enough to solve this question for me with the

following
procedu



I would like UserForm to allow the user to enter 1 wiget and 2 gadgets

(for
example) then have my procedure list that information in a range like so:

NO ITEM
1 widget
2 gadget
3 gadget



Dim j as long, i as Long, k as Long

j = 0
for k = 1 to 4 Step 2
for i = 1 to clng(Userform1.controls("Textbox" & k).Text)
j = j + 1
activecell.offset(j-1,1).Value = j
activeCell.offset(j-1,2).Value = _
Userform1.controls("TextBox" & k + 1).Text
Next i
Next k
ActiveCell.offset(j,0).Select



Now I would like to include a TB in the UserForm to collect a price so the
WS range will appear as such:



NO ITEM PRICE
1 widget $1.00
2 gadget $2.00
3 gadget $2.00



Please advise what I must include in the procedure to create. TIA.

Jim Kobzeff



  #3   Report Post  
Posted to microsoft.public.excel.programming
JK JK is offline
external usenet poster
 
Posts: 78
Default Fill-in Range from UserForm

Thank you, Tom. You're a genius.
Jim Kobzeff

"Tom Ogilvy" wrote in message
...
if you follow the same pattern so you will have 2 sets of 3 textboxes
sequentially numbered

Textbox1 - quantity
Textbox2 - name
Textbox3 - price


Textbox4 - quantity
Textbox5 - name
Textbox6 - price


Dim j as long, i as Long, k as Long

j = 0
for k = 1 to 6 Step 3
for i = 1 to clng(Userform1.controls("Textbox" & k).Text)
j = j + 1
activecell.offset(j-1,1).Value = j
activeCell.offset(j-1,2).Value = _
Userform1.controls("TextBox" & k + 1).Text
activecell.offset(j-1,3).value = _
Userforms1.controls("TextBox" & k + 2).Text
Next i
Next k
ActiveCell.offset(j,0).Select

--
Regards,
Tom Ogilvy


"JK" wrote in message news:CkFTf.4984$vy.2631@trnddc01...
Tom Ogilvy was kind enough to solve this question for me with the

following
procedu



I would like UserForm to allow the user to enter 1 wiget and 2 gadgets

(for
example) then have my procedure list that information in a range like so:

NO ITEM
1 widget
2 gadget
3 gadget



Dim j as long, i as Long, k as Long

j = 0
for k = 1 to 4 Step 2
for i = 1 to clng(Userform1.controls("Textbox" & k).Text)
j = j + 1
activecell.offset(j-1,1).Value = j
activeCell.offset(j-1,2).Value = _
Userform1.controls("TextBox" & k + 1).Text
Next i
Next k
ActiveCell.offset(j,0).Select



Now I would like to include a TB in the UserForm to collect a price so
the
WS range will appear as such:



NO ITEM PRICE
1 widget $1.00
2 gadget $2.00
3 gadget $2.00



Please advise what I must include in the procedure to create. TIA.

Jim Kobzeff




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
SumIf - when I fill down the Range, Criteria & sum range changes markholt Excel Worksheet Functions 3 October 28th 08 12:37 AM
UserForm when opening workbook will not fill screen Anna B Excel Programming 4 February 28th 06 07:48 PM
Fill-in Range from UserForm JK Excel Programming 3 October 15th 05 04:32 PM
How to fill a range with data from another range? Themis Excel Discussion (Misc queries) 4 September 15th 05 07:29 PM
UserForm To A Range Dan Gesshel Excel Programming 2 August 29th 03 01:03 PM


All times are GMT +1. The time now is 09:25 AM.

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"