Hello All,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
<o></o>
I have been using this fantastic forum for many months now without having to post, a big thanks you to you all!<o></o>
This is my first so I apologise if I haven't posted quite right. Please point me in the right direction!<o></o>
Excel 2007 VBA
<o></o>
Please can anyone help with the below?<?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" /><v:shapetype id=_x0000_t75 stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" oreferrelative="t" o:spt="75" coordsize="21600,21600"> <v:stroke joinstyle="miter"></v:stroke><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"></v:f><v:f eqn="sum @0 1 0"></v:f><v:f eqn="sum 0 0 @1"></v:f><v:f eqn="prod @2 1 2"></v:f><v:f eqn="prod @3 21600 pixelWidth"></v:f><v:f eqn="prod @3 21600 pixelHeight"></v:f><v:f eqn="sum @0 0 1"></v:f><v:f eqn="prod @6 1 2"></v:f><v:f eqn="prod @7 21600 pixelWidth"></v:f><v:f eqn="sum @8 21600 0"></v:f><v:f eqn="prod @7 21600 pixelHeight"></v:f><v:f eqn="sum @10 21600 0"></v:f></v:formulas><vath o:connecttype="rect" gradientshapeok="t" o:extrusionok="f"></vath><o:lock aspectratio="t" v:ext="edit"></o:lock></v:shapetype><v:shape id=Picture_x0020_1 style="VISIBILITY: visible; WIDTH: 12pt; HEIGHT: 15.75pt; mso-wrap-style: square" alt="0" type="#_x0000_t75" o:spid="_x0000_i1025"><v:imagedata o:title="0" src="file:///C:\DOCUME~1\JASON~1.BEB\LOCALS~1\Temp\msohtmlclip1\01\clip_image001.gif"></v:imagedata></v:shape><o></o>
<o></o>
The below piece of code Sub RPCSUpdateCategories() is for updating 40 CheckBox Captions on a userfrm from the sheet RPCSSystemsUse Range("B16:B55").<o></o>
I have only included a few to save space on the board.<o></o>
<o></o>
"Sub RPCSUpdateCategories()<o></o>
<o></o>
'RPCS Summary Categories
IPPMainFRM.CheckBox1.Caption = Worksheets("RPCSSystemsUSE").Range("B16").Value
IPPMainFRM.CheckBox2.Caption = Worksheets("RPCSSystemsUSE").Range("B17").Value
IPPMainFRM.CheckBox3.Caption = Worksheets("RPCSSystemsUSE").Range("B18").Value
IPPMainFRM.CheckBox4.Caption = Worksheets("RPCSSystemsUSE").Range("B19").Value
IPPMainFRM.Repaint<o></o>
End Sub"<o></o>
<o></o>
What I am trying to achieve is the above but without 40 lines of repeated code.<o></o>
<o></o>
The below code won't work because I can't figure out how to make the CheckBox include a variable as part of its name? <o></o>
<o></o>
RPCSCheckBoxesName would be CheckBox1 to 40 if its not a variable.<o></o>
<o></o>
"Sub Testcheckboxes()<o></o>
Dim RPCSCategoryRange As Long
Dim RPCSCheckBoxesNo As Long
Dim RPCSCheckBoxesName As String<o></o>
<o></o>
RPCSCategoryRange = 16
For RPCSCheckBoxesNo = 1 To 40<o></o>
RPCSCategoryRange = RPCSCategoryRange + 1<o></o>
RPCSCheckBoxesName = "CheckBox" & RPCSCheckBoxesNo<o></o>
If Range("B" & RPCSCategoryRange).Value = "" Then<o></o>
Else<o></o>
IPPMainFRM.RPCSCheckBoxesName.Caption = Worksheets("RPCSSystemsUSE").Range("B" & RPCSCategoryRange).Value
IPPMainFRM.Repaint
End If<o></o>
<o></o>
Next RPCSCheckBoxesNo<o></o>
<o></o>
End Sub"<o></o>
<o></o>
Any help would be greatly appreciated,<o></o>
<o> </o>
Thanks,<o></o>
<o> </o>
Jase <o></o>
<o></o>
I have been using this fantastic forum for many months now without having to post, a big thanks you to you all!<o></o>
This is my first so I apologise if I haven't posted quite right. Please point me in the right direction!<o></o>
Excel 2007 VBA
<o></o>
Please can anyone help with the below?<?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" /><v:shapetype id=_x0000_t75 stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" oreferrelative="t" o:spt="75" coordsize="21600,21600"> <v:stroke joinstyle="miter"></v:stroke><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"></v:f><v:f eqn="sum @0 1 0"></v:f><v:f eqn="sum 0 0 @1"></v:f><v:f eqn="prod @2 1 2"></v:f><v:f eqn="prod @3 21600 pixelWidth"></v:f><v:f eqn="prod @3 21600 pixelHeight"></v:f><v:f eqn="sum @0 0 1"></v:f><v:f eqn="prod @6 1 2"></v:f><v:f eqn="prod @7 21600 pixelWidth"></v:f><v:f eqn="sum @8 21600 0"></v:f><v:f eqn="prod @7 21600 pixelHeight"></v:f><v:f eqn="sum @10 21600 0"></v:f></v:formulas><vath o:connecttype="rect" gradientshapeok="t" o:extrusionok="f"></vath><o:lock aspectratio="t" v:ext="edit"></o:lock></v:shapetype><v:shape id=Picture_x0020_1 style="VISIBILITY: visible; WIDTH: 12pt; HEIGHT: 15.75pt; mso-wrap-style: square" alt="0" type="#_x0000_t75" o:spid="_x0000_i1025"><v:imagedata o:title="0" src="file:///C:\DOCUME~1\JASON~1.BEB\LOCALS~1\Temp\msohtmlclip1\01\clip_image001.gif"></v:imagedata></v:shape><o></o>
<o></o>
The below piece of code Sub RPCSUpdateCategories() is for updating 40 CheckBox Captions on a userfrm from the sheet RPCSSystemsUse Range("B16:B55").<o></o>
I have only included a few to save space on the board.<o></o>
<o></o>
"Sub RPCSUpdateCategories()<o></o>
<o></o>
'RPCS Summary Categories
IPPMainFRM.CheckBox1.Caption = Worksheets("RPCSSystemsUSE").Range("B16").Value
IPPMainFRM.CheckBox2.Caption = Worksheets("RPCSSystemsUSE").Range("B17").Value
IPPMainFRM.CheckBox3.Caption = Worksheets("RPCSSystemsUSE").Range("B18").Value
IPPMainFRM.CheckBox4.Caption = Worksheets("RPCSSystemsUSE").Range("B19").Value
IPPMainFRM.Repaint<o></o>
End Sub"<o></o>
<o></o>
What I am trying to achieve is the above but without 40 lines of repeated code.<o></o>
<o></o>
The below code won't work because I can't figure out how to make the CheckBox include a variable as part of its name? <o></o>
<o></o>
RPCSCheckBoxesName would be CheckBox1 to 40 if its not a variable.<o></o>
<o></o>
"Sub Testcheckboxes()<o></o>
Dim RPCSCategoryRange As Long
Dim RPCSCheckBoxesNo As Long
Dim RPCSCheckBoxesName As String<o></o>
<o></o>
RPCSCategoryRange = 16
For RPCSCheckBoxesNo = 1 To 40<o></o>
RPCSCategoryRange = RPCSCategoryRange + 1<o></o>
RPCSCheckBoxesName = "CheckBox" & RPCSCheckBoxesNo<o></o>
If Range("B" & RPCSCategoryRange).Value = "" Then<o></o>
Else<o></o>
IPPMainFRM.RPCSCheckBoxesName.Caption = Worksheets("RPCSSystemsUSE").Range("B" & RPCSCategoryRange).Value
IPPMainFRM.Repaint
End If<o></o>
<o></o>
Next RPCSCheckBoxesNo<o></o>
<o></o>
End Sub"<o></o>
<o></o>
Any help would be greatly appreciated,<o></o>
<o> </o>
Thanks,<o></o>
<o> </o>
Jase <o></o>