|
楼主 |
发表于 2010-8-16 09:59
|
显示全部楼层
跨行输入就是第一组入库数据在第一行显示,第二组入库数据却在第六行显示,大概就是这样。宏命令如下
Sub queding()
Application.ScreenUpdating = False '关闭屏幕更新
Application.DisplayAlerts = False
Application.Calculation = xlCalculationManual
Dim irowa As Integer
irowa = Sheet8.[a65536].End(xlUp).Row
With Sheet8
.Cells(irowa + 1, 13) = Cells(3, 7).Value
.Cells(irowa + 1, 14) = Cells(3, 10).Value
.Cells(irowa + 1, 15) = Cells(13, 4).Value
.Cells(irowa + 1, 16) = Cells(13, 9).Value
For tq = 5 To 10
irowa = irowa + 1
.Range("a" & irowa & ":i" & irowa) = Range("b" & tq & ":j" & tq).Value
.Range("j" & irowa & ":k" & irowa) = Range("o" & tq & ":p" & tq).Value
.Range("l" & irowa & ":l" & irowa) = Range("k" & tq & ":k" & tq).Value
Next
End With
Range("b5:b10") = ""
Range("f5:g10") = ""
Range("i5:i10") = ""
Range("k5:k10") = ""
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub |
|