那试试,如果不行,做个具体例子发上来测试
msgbox(rw ("颜色2") & " " & (rw ("颜色2")=nothing))
If rw ("颜色2") <> nothing Then
rt.Cells(3,0).Text = rw ("颜色2")
rt.Cells(3,1).Text = rw ("排名1")
rt.Cells(3,2).Text = rw ("2数量")
rt.Cells(3,3).Text = rw ("总仓1")
rt.Cells(3,4).Text = rw ("门店1")
rt.Cells(3,5).Text = rw ("补货未到2")
rt.Cells(3,6).Text = rw ("分布店铺1")
rt.Cells(3,7).Text = rw ("销售店铺1")
else
rt.Cells(3,0).Text = ""
rt.Cells(3,1).Text = ""
rt.Cells(3,2).Text = ""
rt.Cells(3,3).Text = ""
rt.Cells(3,4).Text = ""
rt.Cells(3,5).Text = ""
rt.Cells(3,6).Text = ""
rt.Cells(3,7).Text = ""
End If