Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/vba/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/excel/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
用VBA填充单元格_Vba_Excel - Fatal编程技术网

用VBA填充单元格

用VBA填充单元格,vba,excel,Vba,Excel,下面出了点问题,但我不知道是什么。除最后两个If语句外,所有内容都将填充。我没有从excel中得到任何错误,它只是没有填充 If NTC.Region.Value = "China" Then Sheet1.Cells(87, 6).Value = "N/A" Sheet1.Cells(88, 6).Value = "N/A" If NTC.RAR.Value = "No" Then Sheet1.Cells(94, 6).Value = "N/A" If NTC.Rate1.Value =

下面出了点问题,但我不知道是什么。除最后两个If语句外,所有内容都将填充。我没有从excel中得到任何错误,它只是没有填充

If NTC.Region.Value = "China" Then
Sheet1.Cells(87, 6).Value = "N/A"
Sheet1.Cells(88, 6).Value = "N/A"

If NTC.RAR.Value = "No" Then
Sheet1.Cells(94, 6).Value = "N/A"

If NTC.Rate1.Value = "Floating" Then
Sheet1.Cells(75, 6).Value = "N/A"

End If

由于缺少
End If
一切都与是否
NTC.Region.Value=“China”

试试这个:

'create a block if because you want to do more than 1 thing
If NTC.Region.Value = "China" Then
    Sheet1.Cells(87, 6).Value = "N/A"
    Sheet1.Cells(88, 6).Value = "N/A"
End if

'Changed to 1 line if statement
If NTC.RAR.Value = "No" Then Sheet1.Cells(94, 6).Value = "N/A"

'Changed to 1 line if statement
If NTC.Rate1.Value = "Floating" Then Sheet1.Cells(75, 6).Value = "N/A"

由于缺少
End If
一切都与是否
NTC.Region.Value=“China”

试试这个:

'create a block if because you want to do more than 1 thing
If NTC.Region.Value = "China" Then
    Sheet1.Cells(87, 6).Value = "N/A"
    Sheet1.Cells(88, 6).Value = "N/A"
End if

'Changed to 1 line if statement
If NTC.RAR.Value = "No" Then Sheet1.Cells(94, 6).Value = "N/A"

'Changed to 1 line if statement
If NTC.Rate1.Value = "Floating" Then Sheet1.Cells(75, 6).Value = "N/A"

请在线检查VBA中
if/then/else
语句的正确格式。还要检查VBA中一行
if
语句的格式请联机检查VBA中
if/then/else
语句的正确格式。还要检查VBA中的一行
if
语句的格式