P
Patrick C. Simonds
I have a series of cells on a worksheet which when clicked on open a
DialogBox. The DialogBox has ListBox which references another worksheet in
the same workbook, when I click OK it deposits the ListBox value into the
triggering cell. All of this works great, except, I also need to maintain
the font formatting (color) when it places the value in the triggering cell.
Is there any way to modify the code below to accomplish this?
Private Sub CommandButton1_Click()
'This UserForm is used to populate the Operator to Cover section of the
worksheet
On Error GoTo EndMacro
Friday_Routes_to_Cover.Hide
DoEvents
Dim rng
Set rng = Cells(ActiveCell.Row, 1)
rng(1, 4).Value = ListBox1.List(ListBox1.ListIndex, 0)
rng(1, 7).Value = ListBox1.List(ListBox1.ListIndex, 1)
rng(1, 10).Value = ListBox1.List(ListBox1.ListIndex, 2)
rng(1, 13).Value = ListBox1.List(ListBox1.ListIndex, 3)
rng(1, 6).Value = ListBox1.List(ListBox1.ListIndex, 13)
rng(1, 9).Value = ListBox1.List(ListBox1.ListIndex, 14)
rng(1, 12).Value = ListBox1.List(ListBox1.ListIndex, 15)
rng(1, 15).Value = ListBox1.List(ListBox1.ListIndex, 16)
Unload Friday_Routes_to_Cover
EndMacro:
Unload Friday_Routes_to_Cover
End Sub
DialogBox. The DialogBox has ListBox which references another worksheet in
the same workbook, when I click OK it deposits the ListBox value into the
triggering cell. All of this works great, except, I also need to maintain
the font formatting (color) when it places the value in the triggering cell.
Is there any way to modify the code below to accomplish this?
Private Sub CommandButton1_Click()
'This UserForm is used to populate the Operator to Cover section of the
worksheet
On Error GoTo EndMacro
Friday_Routes_to_Cover.Hide
DoEvents
Dim rng
Set rng = Cells(ActiveCell.Row, 1)
rng(1, 4).Value = ListBox1.List(ListBox1.ListIndex, 0)
rng(1, 7).Value = ListBox1.List(ListBox1.ListIndex, 1)
rng(1, 10).Value = ListBox1.List(ListBox1.ListIndex, 2)
rng(1, 13).Value = ListBox1.List(ListBox1.ListIndex, 3)
rng(1, 6).Value = ListBox1.List(ListBox1.ListIndex, 13)
rng(1, 9).Value = ListBox1.List(ListBox1.ListIndex, 14)
rng(1, 12).Value = ListBox1.List(ListBox1.ListIndex, 15)
rng(1, 15).Value = ListBox1.List(ListBox1.ListIndex, 16)
Unload Friday_Routes_to_Cover
EndMacro:
Unload Friday_Routes_to_Cover
End Sub