Sub test()
Dim Arr, Ar(1 To 27, 1 To 3), R%, C%, i&
Application.ScreenUpdating = False
Ar(1, 1) = "編 號": Ar(1, 2) = "姓 名": Ar(1, 3) = "簽 章"
R = 3: C = 5: N = 1
Arr = Range([會員資料!A1], [會員資料!B65536].End(3))
For i = 1 To UBound(Arr)
N = N + 1: Ar(N, 1) = Arr(i, 1): Ar(N, 2) = Arr(i, 2)
If N = 26 Then
With Sheets("會員簽到簿").Cells(R, C).Resize(N, 3)
.Value = Ar
.Borders.LineStyle = xlContinuous
End With
C = C + 4: N = 1
End If
If C > 13 Then C = 5: R = R + 28
Next
If N > 1 Then
With Sheets("會員簽到簿").Cells(R, C).Resize(N, 3)
.Value = Ar
.Borders.LineStyle = xlContinuous
End With
End If
Application.ScreenUpdating = True
End Sub作者: dou10801 時間: 2021-4-23 14:37
Sub test2()
Dim Arr, Ar(1 To 27, 1 To 3), R%, C%, i&
Application.ScreenUpdating = False
Ar(1, 1) = "編 號": Ar(1, 2) = "姓 名": Ar(1, 3) = "簽 章"
R = 3: C = 5: N = 1
Arr = Range([會員資料!A1], [會員資料!B65536].End(3))
For i = 1 To UBound(Arr)
N = N + 1: Ar(N, 1) = Arr(i, 1): Ar(N, 2) = Arr(i, 2)
If N = 26 Then
With Sheets("會員簽到簿").Cells(R, C).Resize(N, 3)
.Value = Ar
.Borders.LineStyle = xlContinuous
End With
C = C + 4: N = 1
End If
If C > 17 Then C = 5: R = R + 28 'C:填入資料位置(換頁),可自行調整
Next
If N > 1 Then
With Sheets("會員簽到簿").Cells(R, C).Resize(N, 3)
.Value = Ar
.Borders.LineStyle = xlContinuous
End With
End If
Application.ScreenUpdating = True
End Sub作者: dou10801 時間: 2021-4-23 16:05
試試看
Sub ex()
Dim x%, y%, z%
For x = 1 To Sheets("會員資料").[a65535].End(3).Row Step 25
With Sheets("會員簽到簿1")
.[a3].Offset(y, z).Resize(, 3) = Array("編 號", " 姓名", "簽章")
Cells(x, 1).Resize(25, 3).Copy .[a4].Offset(y, z)
With .[a3].Offset(y, z).CurrentRegion
.Borders.LineStyle = xlContinuous
End With
z = z + 4
If z = 16 Then z = 0: y = y + 28
End With
Next
End Sub作者: dou10801 時間: 2021-4-26 07:56
Sub ex()
Dim x%, y%, z%
For x = 1 To WorksheetFunction.RoundUp(Sheets("會員資料").[a65535].End(3).Row / 100, 0) * 100 Step 25
With Sheets("會員簽到簿1")
.[a3].Offset(y, z).Resize(, 3) = Array("編 號", " 姓名", "簽章")
Cells(x, 1).Resize(25, 3).Copy .[a4].Offset(y, z)
With .[a3].Offset(y, z).Resize(26, 3)
.Borders.LineStyle = xlContinuous
End With
z = z + 4
If z = 16 Then z = 0: y = y + 28
End With
Next
End Sub