- 日志
- 好友
- 卖家信用

- 买家信用

- 注册时间
- 2006-2-22
- 在线时间
- 小时
|

楼主 |
发表于 2011-12-11 23:10:34
|
显示全部楼层
sundf 发表于 2011-12-11 22:42 
Descolumncount是什么类型呀?
上次也是随便写了个,试了下和你添附的东西可以出来同样的结果。具体哪里不 ... - Sub Remark()
- Dim myRng As Range
- Dim i As Long
- Dim j As Long
- Dim ret
- Worksheets("Exterior competition").Copy after:=Worksheets("Exterior competition")
- ActiveSheet.Name = "Remark"
- Worksheets("Remark").Activate
- ActiveCell.CurrentRegion.Select
-
-
- ret = dosheet("Interior competition", "Exterior competition", "Remark", Descolumncount)
- End Sub
- Function dosheet(Sheet1 As String, Sheet2 As String, Sheet3 As String, descount As Integer)
- Dim StartRow, StartCol, EndRow, EndCol, tmpr, tmpc As Integer
- Dim f As Integer
- EndRow = Sheets(Sheet1).Cells.SpecialCells(xlLastCell).Row
- EndCol = Sheets(Sheet1).Cells.SpecialCells(xlLastCell).Column
- StartRow = 2
- StartCol = 2
- For tmpr = StartRow To EndRow
- For tmpc = StartCol To EndCol
- 'descount-1????
- If tmpc < Descolumncount Then
- Sheets(Sheet3).Cells(tmpr, tmpc) = Sheets(Sheet1).Cells(tmpr, tmpc) * Sheets(Sheet2).Cells(tmpr, tmpc)
- Else
- '??COPY
- Sheets(Sheet3).Cells(tmpr, tmpc) = Sheets(Sheet1).Cells(tmpr, tmpc)
- End If
- Next tmpc
- Next tmpr
- End Function
复制代码 |
|