|
楼主 |
发表于 2014-6-26 23:47
|
显示全部楼层
结合楼上两位老师的指点,修改了程序,目前已能正常运行,再次表示感谢。
程序如下:
--------------------------------------------------------------------------------------
Function mingxi()
'每天的出库明细
Dim Sheet1 As Worksheet, Sheet2 As Worksheet
Dim mycol As Integer
Dim cheng As Double
Set Sheet1 = ThisWorkbook.Worksheets(1)
Set Sheet2 = ThisWorkbook.Worksheets(2)
mingxi = " "
For mycol = 2 To 100
If Sheet1.Cells(mycol, 2).Value <> "" Then
cheng = Sheet1.Cells(mycol, 2).Value * Sheet1.Cells(mycol, 3).Value
mingxi = mingxi & " " & Sheet1.Cells(mycol, 1).Value & Sheet1.Cells(mycol, 2).Value & "斤*" & Sheet1.Cells(mycol, 3).Value & "元=" & CStr(cheng) & "元"
'MsgBox (mingxi)
End If
Next mycol
End Function
--------------------------------------------------------------------------------------
|
|