VBA填充特定单元格的范围

时间:2016-10-20 06:36:42

标签: vba excel-vba excel

在工作表中我有"日期"在Options +FollowSymLinks -MultiViews RewriteEngine On RewriteBase / RewriteCond %{REQUEST_METHOD} !POST RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] RewriteRule ^(.*)$ http://%1/$1 [R=301,L] RewriteCond %{REQUEST_METHOD} !POST RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php [NC] RewriteRule ^ %1 [R=301,L,NE] RewriteCond %{REQUEST_FILENAME}.php -f RewriteRule ^(.+?)/?$ $1.php [L] RewriteRule ^post\.php$ / [L,NC] Cells(1,1)Cells(1,10)Cells(1,19) .....

我有一个名为Cells(1,28)的变量,在我的情况下是860,我需要放在每个" Dates" nr_rowsRow 1的结果直到Row 2

结果必须如下:

Row 860

这就是我所做的,但我有错误 | A | J | S |..... ----------------------------------------------------------- 1 | 21.02.16 16:20 | 21.02.16 16:21 | 21.02.16 16:22 |..... 2 | 21.02.16 16:20 | 21.02.16 16:21 | 21.02.16 16:22 |..... 3 | 21.02.16 16:20 | 21.02.16 16:21 | 21.02.16 16:22 |..... ..................................................................... 860 | 21.02.16 16:20 | 21.02.16 16:21 | 21.02.16 16:22 |.....

1004

nr_rows is 860

1 个答案:

答案 0 :(得分:0)

关于退出AutoFill()方法

的OP澄清后

已编辑

使用它:

Option Explicit

Sub main()
    Dim nr_rows As Long, col As Long

    nr_rows = 860
    With ActiveSheet
        For col = 1 To 256 Step 9
            .Cells(1, col).Resize(nr_rows).Value = .Cells(1, col).Value
        Next col
    End With
End Sub