- 博客(1)
- 资源 (3)
- 收藏
- 关注
转载 正则表达式 ?P<name>
import re # 将匹配的数字乘以 2 def double(matched): value = int(matched.group('value')) return str(value * 2) s = 'A23G4HFD567' print(re.sub('(?P<value>\d+)', double, s)) 从中也可以理解,url(r'^(?P<username>[\w.@+-]+)/$', views.user_profile, na.
2021-04-03 15:45:30 497
VBA实现进度条的显示
VBA实现进度条的显示
Sub Test()
' The UserForm1_Activate sub calls Main
UserForm1.LabelProgress.Width = 0
UserForm1.Show
End Sub
Private Sub UserForm_activate()
Call Main
End Sub
Sub Main()
' Inserts random numbers on the active worksheet
Dim Counter As Integer
Dim RowMax As Integer, ColMax As Integer
Dim r As Integer, c As Integer
Dim Completed As Single
If TypeName(ActiveSheet) "Worksheet" Then Exit Sub
Cells.Clear
Application.ScreenUpdating = False
Counter = 1
RowMax = 100
ColMax = 25
For r = 1 To RowMax
For c = 1 To ColMax
Cells(r, c) = Int(Rnd * 1000)
Counter = Counter + 1
Next c
Completed = Counter / (RowMax * ColMax)
With UserForm1
.FrameProgress.Caption = Format(Completed, "0%")
.LabelProgress.Width = Completed * (.FrameProgress.Width)
End With
' The DoEvents statement is responsible for the form updating
DoEvents
Next r
Unload UserForm1
End Sub
2010-06-27
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人