Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Refer to Combo-box using a part + variable
I have 10 combo-boxes called:
CBoxOwner1, CBoxOwner2, CBoxOwner3 etc I need to write the contents of each box (using a loop) to a sheet using i as the loop variable to refer to the particular combo-box. Obviously the segment: CBoxOwner & i doesn't work to refer to CBoxOwner1 when i = 1 etc For i = 1 To 10 Cells(i + 2, 3) = frmTransportRequest.CBoxOwner & i Next i Is it possible to do this within a loop? Peter |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Refer to Combo-box using a part + variable
Peter,
Try Dim i As Integer For i = 1 To 10 Cells(i,1).Value = frmTransportRequest.Controls("CBoxOwner" & i).Text Next i -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Peter" wrote in message ... I have 10 combo-boxes called: CBoxOwner1, CBoxOwner2, CBoxOwner3 etc I need to write the contents of each box (using a loop) to a sheet using i as the loop variable to refer to the particular combo-box. Obviously the segment: CBoxOwner & i doesn't work to refer to CBoxOwner1 when i = 1 etc For i = 1 To 10 Cells(i + 2, 3) = frmTransportRequest.CBoxOwner & i Next i Is it possible to do this within a loop? Peter |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Refer to Combo-box using a part + variable
Thanks Chip
I will give it a try. Peter Chip Pearson wrote in message ... Peter, Try Dim i As Integer For i = 1 To 10 Cells(i,1).Value = frmTransportRequest.Controls("CBoxOwner" & i).Text Next i -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Peter" wrote in message ... I have 10 combo-boxes called: CBoxOwner1, CBoxOwner2, CBoxOwner3 etc I need to write the contents of each box (using a loop) to a sheet using i as the loop variable to refer to the particular combo-box. Obviously the segment: CBoxOwner & i doesn't work to refer to CBoxOwner1 when i = 1 etc For i = 1 To 10 Cells(i + 2, 3) = frmTransportRequest.CBoxOwner & i Next i Is it possible to do this within a loop? Peter |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Refer to Combo-box using a part + variable
Yep, it does the trick.
Thanks so much, Chip Peter Chip Pearson wrote in message ... Peter, Try Dim i As Integer For i = 1 To 10 Cells(i,1).Value = frmTransportRequest.Controls("CBoxOwner" & i).Text Next i -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Peter" wrote in message ... I have 10 combo-boxes called: CBoxOwner1, CBoxOwner2, CBoxOwner3 etc I need to write the contents of each box (using a loop) to a sheet using i as the loop variable to refer to the particular combo-box. Obviously the segment: CBoxOwner & i doesn't work to refer to CBoxOwner1 when i = 1 etc For i = 1 To 10 Cells(i + 2, 3) = frmTransportRequest.CBoxOwner & i Next i Is it possible to do this within a loop? Peter |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Making part of a formula a variable | Excel Worksheet Functions | |||
Refer cell value as part of formula | Excel Worksheet Functions | |||
Reference to a Variable Part of a Cell | Excel Worksheet Functions | |||
Variable Input Range for Combo Box | Excel Worksheet Functions | |||
variable to refer to "this worksheet"? | Excel Worksheet Functions |