下面有一些问题,但我无法解决问题。除最后两个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
答案 0 :(得分:2)
由于缺少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"