rivate Sub CommandButton1_Click()
Dim dateCounter As Range
Dim Number As Range
Dim t1 As Range
Dim t2 As Range
Set t1 = Worksheets("数据元").Range(TextBox1.Text)
Set t2 = Worksheets("数据元").Range(TextBox2.Text)
Set Number = Worksheets( "数据元 ").Range( "A2:A12 ")
For dateCounter = t1 To t2
Worksheets( "Sheet4 ").Columns(2).Value = Number
Dim day As Range
Dim i As Integer
For i = 1 To 11
day = dateCounter
Worksheets( "sheet4 ").Colmuns(1).Value = day
Next i
Next dateCounter
End Sub
我需要生成一个第一列是日期,第二列是号码(来自 "数据元 "表)的表格,由于有11个号码,所以每个日期必须循环11次,格式如下:
日期1 号码1
日期1 号码2
...
日期1 号码11
日期2 号码1
日期2 号码2
...
日期2 号码11
...
t1和t2用来导入起始日期和终止日期.
运行的时候显示 "dateCounter类型不匹配 "
谁有办法修改,或者有更好的思路?
谢谢!