在用VBA操作以下代码,如果转为FORTABLE需要怎样编写。
花了二日时间查找了很多资料解决不了
Private Sub M_Click()
Dim i As Integer
Dim j As Integer
Dim h As Integer
h = 1
j = 1
For i = 2 To Sheets("M").[A65536].End(xlUp).Row
j = j + 1
Range("A" & j) = "BBBB"
Range("B" & j) = Sheets("M").Range("O" & i)
If Sheets("M").Range("A" & i) <> Sheets("M").Range("A" & i + 1) Then
Rows(j).Copy Rows(j + 1)
h = h + 1
j = j + 2
End If