|
本帖最后由 lywyb76 于 2014-5-7 09:11 编辑
Public xiangmumingcheng, shebeibaojia1, shebeizuizhongbaojia, shebeiguigexinghao, toubiaogongsimingcheng As Range
Private Sub Worksheet_Activate()
'获得数据浏览表格中项目,报价1,最终报价,规格型号等数据所在的行
For i = 1 To 60
If CStr(Sheets("数据浏览").Cells(i, 1)) = "项目" Then
If Sheets("数据浏览").Cells(i, 2) Is Nothing Then
xiangmumingcheng = "没有数据"
Else
xiangmumingcheng = Sheets("数据浏览").Cells(i, 2)
End If
End If
If CStr(Sheets("数据浏览").Cells(i, 1)) = "设备报价1" Then
If Sheets("数据浏览").Cells(i, 2) Is Nothing Then
shebeibaojia1 = "没有数据"
Else
shebeibaojia1 = Sheets("数据浏览").Cells(i, 2)
End If
End If
If CStr(Sheets("数据浏览").Cells(i, 1)) = "设备最终报价" Then
If Sheets("数据浏览").Cells(i, 2) Is Nothing Then
shebeizuizhongbaojia = "没有数据"
Else
shebeizuizhongbaojia = Sheets("数据浏览").Cells(i, 2)
End If
End If
If CStr(Sheets("数据浏览").Cells(i, 1)) = "设备规格型号" Then
If Sheets("数据浏览").Cells(i, 2) Is Nothing Then
shebeiguigexinghao = "没有数据"
Else
shebeiguigexinghao = Sheets("数据浏览").Cells(i, 2)
End If
End If
If CStr(Sheets("数据浏览").Cells(i, 1)) = "公司名称" Then
If Sheets("数据浏览").Cells(i, 2) Is Nothing Then
toubiaogongsimingcheng = "没有数据"
Else
toubiaogongsimingcheng = Sheets("数据浏览").Cells(i, 2)
End If
End If
Next
调试在红字处停止。请高手赐教!!
ActiveSheet.Cells(2, 1) = "项目:" + xiangmumingcheng
End Sub
|
|