在Userform中更改选项按钮选择

时间:2018-06-05 10:03:26

标签: vba excel-vba userform excel

我创建了一个vba来更改Userform中的选项并部分成功。但我无法更改选项按钮和复选框的数据。我得到一条消息" False"在那一行。请帮帮我!

ProjectName

2 个答案:

答案 0 :(得分:3)

您想在单元格中添加“选项1”,“选项2”或“选项3”吗?

更改以下内容:

    <cdcList xmlns="http://ws.apache.org/ns/synapse" xmlns:nsc="http://eos.mcr.com/cdc/anagrafica/ds">
   <cdc>
      <idCdc>1</idCdc>
      <idCdcParent>0</idCdcParent>
      <cdcName>Roma</cdcName>
      <order>1</order>
      <isUsed>false</isUsed>
      <cdcList>
         <cdc>
            <idCdc>4</idCdc>
            <idCdcParent>1</idCdcParent>
            <cdcName>testMOD</cdcName>
            <order>4</order>
            <isUsed>false</isUsed>
            <cdcList/>
         </cdc>
         <cdc>
            <idCdc>5</idCdc>
            <idCdcParent>1</idCdcParent>
            <cdcName>testMOD</cdcName>
            <order>4</order>
            <isUsed>false</isUsed>
            <cdcList/>
         </cdc>
         <cdc>
            <idCdc>6</idCdc>
            <idCdcParent>1</idCdcParent>
            <cdcName>testMOD</cdcName>
            <order>4</order>
            <isUsed>false</isUsed>
            <cdcList>
                <cdc>
                    <idCdc>7</idCdc>
                    <idCdcParent>6</idCdcParent>
                    <cdcName>testMODChild</cdcName>
                    <order>4</order>
                    <isUsed>false</isUsed>
                    <cdcList/>
                </cdc>
            </cdcList>
         </cdc>
      </cdcList>
   </cdc>
   <cdc>
      <idCdc>2</idCdc>
      <idCdcParent>0</idCdcParent>
      <cdcName>Progetti</cdcName>
      <order>2</order>
      <isUsed>false</isUsed>
      <cdcList>
         <cdc>
            <idCdc>8</idCdc>
            <idCdcParent>2</idCdcParent>
            <cdcName>testGP</cdcName>
            <order>1</order>
            <isUsed>false</isUsed>
            <cdcList/>
         </cdc>
         <cdc>
            <idCdc>9</idCdc>
            <idCdcParent>2</idCdcParent>
            <cdcName>testGPS</cdcName>
            <order>2</order>
            <isUsed>false</isUsed>
            <cdcList/>
         </cdc>
         <cdc>
            <idCdc>10</idCdc>
            <idCdcParent>2</idCdcParent>
            <cdcName>EOS</cdcName>
            <order>3</order>
            <isUsed>false</isUsed>
            <cdcList/>
         </cdc>
      </cdcList>
   </cdc>
   <cdc>
      <idCdc>3</idCdc>
      <idCdcParent>0</idCdcParent>
      <cdcName>Milano</cdcName>
      <order>4</order>
      <isUsed>false</isUsed>
      <cdcList>
         <cdc>
            <idCdc>11</idCdc>
            <idCdcParent>3</idCdcParent>
            <cdcName>l</cdcName>
            <order>4</order>
            <isUsed>false</isUsed>
            <cdcList/>
         </cdc>
      </cdcList>
   </cdc>
</cdcList>

Cells(rowselect, 5) = Me.Option1.Value 
Cells(rowselect, 5) = Me.Option2.Value 
Cells(rowselect, 5) = Me.Option3.Value

答案 1 :(得分:0)

你能这样检查:

key => value

use yii\db\Expression; ... $query = (new \yii\db\Query()) ->select(['id' , 'name' , 'price' , new Expression("'car' AS type") , new Expression("'full' AS tax")]) ->from('products' ); 被赋予3次,每次都重叠。