justuptou
06-11-2019, 06:44 AM
How to use Excel Userform with Checkbox / Option Button value,
then return value to Checkbox / Textbox / Option Button in Winword Form
1) Use the "Print Report" Button, Red Box in figure
2) Get the Checkbox value from Excel Userform
3) Print the information onto Winword Application form. Green & Blue Box in figure
4) I know below coding is not correct, But I am trying to explain my wishes.
Pseudo Code (https://www.google.com/search?safe=strict&rlz=1C1VFKB_enHK628HK628&q=Pseudo+Code&spell=1&sa=X&ved=0ahUKEwjVu4qdxuHiAhWPMN4KHdTkBG0QkeECCCwoAA):
:
:
:
' Green Box in figure
If Optionbutton1.value = true then
doc.tables(1).Cell(4,2).Optionbutton1.value = True
Else
doc.tables(1).Cell(4,2).Optionbutton2.value = False
End if
' Blue Box in figure
If Checkbox1.value = True then
doc.tables(1).Cell(6,1).CheckBox1.value = True
Else
doc.tables(1).Cell(6,1).CheckBox1.value = False
End if
If Checkbox2.value = True then
doc.tables(1).Cell(6,2).CheckBox2.value = True
Else
doc.tables(1).Cell(6,2).CheckBox2.value = False
End if
:
:
:
If Checkbox6.value = True then
doc.tables(1).Cell(7,3).CheckBox6.value = True
Else
doc.tables(1).Cell(7,3).CheckBox6.value = False
End if
:
:
:
then return value to Checkbox / Textbox / Option Button in Winword Form
1) Use the "Print Report" Button, Red Box in figure
2) Get the Checkbox value from Excel Userform
3) Print the information onto Winword Application form. Green & Blue Box in figure
4) I know below coding is not correct, But I am trying to explain my wishes.
Pseudo Code (https://www.google.com/search?safe=strict&rlz=1C1VFKB_enHK628HK628&q=Pseudo+Code&spell=1&sa=X&ved=0ahUKEwjVu4qdxuHiAhWPMN4KHdTkBG0QkeECCCwoAA):
:
:
:
' Green Box in figure
If Optionbutton1.value = true then
doc.tables(1).Cell(4,2).Optionbutton1.value = True
Else
doc.tables(1).Cell(4,2).Optionbutton2.value = False
End if
' Blue Box in figure
If Checkbox1.value = True then
doc.tables(1).Cell(6,1).CheckBox1.value = True
Else
doc.tables(1).Cell(6,1).CheckBox1.value = False
End if
If Checkbox2.value = True then
doc.tables(1).Cell(6,2).CheckBox2.value = True
Else
doc.tables(1).Cell(6,2).CheckBox2.value = False
End if
:
:
:
If Checkbox6.value = True then
doc.tables(1).Cell(7,3).CheckBox6.value = True
Else
doc.tables(1).Cell(7,3).CheckBox6.value = False
End if
:
:
: