- ©«¤l
- 9
- ¥DÃD
- 4
- ºëµØ
- 0
- ¿n¤À
- 13
- ÂI¦W
- 0
- §@·~¨t²Î
- window7
- ³nÅ骩¥»
- office 2010
- ¾\ŪÅv
- 10
- ©Ê§O
- ¤k
- ¨Ó¦Û
- HsinChu
- µù¥U®É¶¡
- 2013-10-14
- ³Ì«áµn¿ý
- 2014-6-26
|
[µo°Ý] µ{¦¡¦b¶]«Üªá®É¶¡,¦p¦ó¥[§Ö³t«×
¥»©«³Ì«á¥Ñ anny8888 ©ó 2013-10-22 17:37 ½s¿è
µ{¦¡¦b¶]®É·|¦b²Ä¤G¬qªº³¡¥÷ªá«Ü¦h®É¶¡, ¦]¬°¨CÓ X ³£»Ýn½T»{ 550Ó¬Û¦PªºQ.....
¥i§_¦³¤èªk¥i¥H¥[§Ö³t«×.......
For q = 2 To 550
If Workbooks("UT_weekly").Sheets(n1).Cells(x, 4) <> "" And Workbooks("UT_weekly").Sheets(n1).Cells(x, 4).Value = Workbooks("mergertosheet3").Sheets(2).Cells(q, 7).Value Then
Workbooks("UT_weekly").Sheets(n1).Cells(x, 17) = Workbooks("mergertosheet3").Sheets(2).Cells(q, 9)
Workbooks("UT_weekly").Sheets(n1).Cells(x, 18) = Workbooks("mergertosheet3").Sheets(2).Cells(q, 8)
End If
Next
Next
======================================================
Sub creform()
Dim x As Integer, y As Integer, q As Integer
Windows("UT_weekly").Activate
For n1 = 1 To 2 Step 1
Sheets(n1).Select
n = Sheets(n1).UsedRange.Rows.Count
'MsgBox n
Columns("C:C").ColumnWidth = 18
Range("N1").FormulaR1C1 = "Product"
Range("O1").FormulaR1C1 = "account"
Range("P1").FormulaR1C1 = "FSE/FPE"
Range("Q1").FormulaR1C1 = "Manager"
Range("R1").FormulaR1C1 = "DFS name"
For x = 2 To [A2].End(xlDown).Row + 5 Step 1
For y = 2 To 100
If Workbooks("UT_weekly").Sheets(n1).Cells(x, 4) <> "" And Workbooks("UT_weekly").Sheets(n1).Cells(x, 2).Value = Workbooks("mergertosheet3").Sheets(2).Cells(y, 1).Value Then
Workbooks("UT_weekly").Sheets(n1).Cells(x, 14) = Workbooks("mergertosheet3").Sheets(2).Cells(y, 2)
Workbooks("UT_weekly").Sheets(n1).Cells(x, 15) = Workbooks("mergertosheet3").Sheets(2).Cells(y, 4)
Workbooks("UT_weekly").Sheets(n1).Cells(x, 16) = Workbooks("mergertosheet3").Sheets(2).Cells(y, 3)
End If
Next
'=============================================================================================
For q = 2 To 550
If Workbooks("UT_weekly").Sheets(n1).Cells(x, 4) <> "" And Workbooks("UT_weekly").Sheets(n1).Cells(x, 4).Value = Workbooks("mergertosheet3").Sheets(2).Cells(q, 7).Value Then
Workbooks("UT_weekly").Sheets(n1).Cells(x, 17) = Workbooks("mergertosheet3").Sheets(2).Cells(q, 9)
Workbooks("UT_weekly").Sheets(n1).Cells(x, 18) = Workbooks("mergertosheet3").Sheets(2).Cells(q, 8)
End If
Next
Next
'==============================================================================================================
For x = 2 To [A2].End(xlDown).Row + 5 Step 1
If Workbooks("UT_weekly").Sheets(n1).Cells(x, 4) = "" And Workbooks("UT_weekly").Sheets(n1).Cells(x, 3) <> "" Then
Rows(x).Font.Bold = True
End If
Next
'==========================================================
Next
End Sub |
|