- ©«¤l
- 1446
- ¥DÃD
- 40
- ºëµØ
- 0
- ¿n¤À
- 1470
- ÂI¦W
- 0
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Excel 2010 & 2016
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW
- µù¥U®É¶¡
- 2020-7-15
- ³Ì«áµn¿ý
- 2024-10-21
|
¥»©«³Ì«á¥Ñ Andy2483 ©ó 2023-3-9 13:16 ½s¿è
¦^´_ 1# §ÚªÎ¤H
ÁÂÁ«e½úµoªí¦¹¥DÃD»P½d¨Ò
«á¾Ç½m²ß°}¦C¥H»²§Uªíªº¤è¦¡ °µ¸ê®Æ ×§ï §@·~ªº¸Ñ¨M¤è®×,½Ð«e½ú°Ñ¦Ò
°õ¦æ¤è¦¡:
1.¿ï¨ú¸ê®Æªí¨ä¤¤¤@¦C©Î¤@®æ«á«öקï¶s:
1.1.°õ¦æµ²ªG:
2.קï¸ê®Æ«á½Ð¤Á´«¦^¸ê®Æªí "Worksheet":
3.§¹¦¨×§ï:
form_20230309_1.zip (40.77 KB)
Option Explicit
Sub ½s¿èקï¼Ò¦¡()
Dim Arr, Brr, R&
Application.DisplayAlerts = False
If Selection.Rows.Count > 1 Then MsgBox "¨C¦¸¥u¯àקï¤@¦C¸ê®Æ": Exit Sub
If Selection.Row <= 6 Or Cells(Selection.Row, 1) = "" Then
MsgBox "¥ý¿ï¨úקï¦C": Exit Sub
End If
R = Selection.Row: Arr = [A6:Q6]: Brr = Range(Cells(R, "A"), Cells(R, "Q"))
Rows(R).Font.ColorIndex = 1
On Error Resume Next
Sheets("Modify").Delete
On Error GoTo 0
Worksheets.Add(After:=Sheets(Sheets.Count)).Name = "Modify"
[A2].Resize(UBound(Arr, 2), 1) = Application.Transpose(Arr)
[A2].Resize(UBound(Arr, 2), 1).Interior.ColorIndex = 35
[B2].Resize(UBound(Brr, 2), 1) = Application.Transpose(Brr)
[A1] = "¶µ¥Ø": [B1] = "ìÈ": [C1] = "·sÈ"
Cells.Font.Size = 14
[A:B].EntireColumn.AutoFit
[C:C].ColumnWidth = [B:B].ColumnWidth * 2
ActiveSheet.UsedRange.Borders.LineStyle = xlContinuous
[D1] = R
ActiveSheet.Protection.AllowEditRanges.Add Title:="½d³ò1", Range:=[C2].Resize(UBound(Brr, 2), 1)
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, Password:="0000"
Sheets("Worksheet").Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, Password:="0000"
End Sub
=============================================
Sub קï¸ê®Æ±a¤J¸ê®Æªí()
Dim Arr, R&, i&
If Sheets("Modify").Cells(Rows.Count, "C").End(3).Row = 1 Then MsgBox "¨S¦³×§ï": Exit Sub
Arr = Sheets("Modify").UsedRange
R = Sheets("Modify").[D1]
For i = 2 To UBound(Arr)
If Trim(Arr(i, 3)) <> "" Then
Sheets("Worksheet").Cells(R, i - 1) = Trim(Arr(i, 3))
Sheets("Worksheet").Cells(R, i - 1).Font.ColorIndex = 5
End If
Next
End Sub
======================================
Private Sub Worksheet_Activate()
ActiveSheet.Unprotect "0000"
Call קï¸ê®Æ±a¤J¸ê®Æªí
Application.DisplayAlerts = False
Sheets("Modify").Delete
End Sub |
|