- ©«¤l
- 216
- ¥DÃD
- 71
- ºëµØ
- 0
- ¿n¤À
- 292
- ÂI¦W
- 0
- §@·~¨t²Î
- window xp
- ³nÅ骩¥»
- 2007
- ¾\ŪÅv
- 20
- ©Ê§O
- ¤k
- µù¥U®É¶¡
- 2012-6-27
- ³Ì«áµn¿ý
- 2024-9-28
|
¥»©«³Ì«á¥Ñ missbb ©ó 2016-11-14 19:56 ½s¿è
§Ú¸ÕÅç¦C³Ì«á¤@¨B¤F, ´N¬O¥i¥H¥Î³¡ªù©Îû¤u½s¸¹¿z¿ï, ¦b¿z¿ï³¡ªù¬O§¹¥þµL°ÝÃD, ¦ýÂk¿ïû¤u½s¸¹, ¤S¦h¥X¤@±i¤u§@ªí, ·Q¨Ó·Q¥h·Q¤£³q, ½Ð¤j¤jÀ°¦£:'(
VBA ¥Ó½Ðªí 20161114v1 (2).zip (19.07 KB)
- Sub copytosheetok02()
- 'step select dept -> create appraisal form based on sheet result
- With Sheets("list").Activate
- Dim yn As Integer
- yn = MsgBox(prompt:="¦pªG¿z¿ï³¡ªù, ½Ð«ö¬O", Buttons:=vbYesNo + vbQuestion)
- If yn = vbYes Then
- dept = InputBox("¿z¿ï³¡ªù:")
- Range("a1").AutoFilter Field:=2, Criteria1:=dept
- ActiveSheet.UsedRange.Select
- Selection.copy
- Sheets.Add After:=Sheets(Sheets.Count)
- Sheets(Sheets.Count).Name = "result"
- Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
- xlNone, SkipBlanks:=False, Transpose:=False
-
- Else
- ID = InputBox("¿z¿ï½s¸¹:")
- Range("a1").AutoFilter Field:=1, Criteria1:=ID
- ActiveSheet.UsedRange.Select
- Selection.copy
- Sheets.Add After:=Sheets(Sheets.Count)
- Sheets(Sheets.Count).Name = "result"
- Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
- xlNone, SkipBlanks:=False, Transpose:=False
- End If
- End With
- Dim MyCell As Range, MyRange As Range
- Set MyRange = Sheets("result").Range("A2")
- Set MyRange = Range(MyRange, MyRange.End(xlDown))
- Application.ScreenUpdating = False
- Application.DisplayAlerts = False
- For Each MyCell In MyRange
- Sheets("form").copy After:=Sheets(Sheets.Count) 'Create a new worksheet
- [color=Red]Sheets(Sheets.Count).Name = MyCell.Value 'Renames the new worksheet[/color]s
- '¥Dn°ÝÃD´N¥X¦b³o¥y¤F??????
- For i = 4 To Sheets.Count
- With Sheets(i).Range("A1:E7")
- .Value = .Value
- End With
-
- With Sheets(i).Range("A10:B11")
- .Value = .Value
- End With
- Next i
- Next MyCell
- Application.ScreenUpdating = True
- Application.DisplayAlerts = True
- End Sub
½Æ»s¥N½X |
|