返回列表 上一主題 發帖

請問有什麼錯,錯在哪裡

請問有什麼錯,錯在哪裡

sub namerecord()
Dim friendname As String
Dim i As Integer
i = 2
For i = 2 To 50

Worksheets("sample").Copy after:=Worksheets(Worksheets.Count)
Worksheets(Worksheets.Count).name = friendname
If Worksheets("Main").Cells(2, 2).Value = "friendname" Then Worksheets(Worksheets.Count).Cells(2, 2).Value
i = i + 1
End If

End Sub

有  for  卻無 next for
另外 您所發的這個 我剛有測試了一下
但是 除了活頁數量有增加以外
似乎看不出有其他功能...
會變成
sample(1)
sample(2)
sample(3)
sample(4)
這樣...
不好意思 小弟功力不夠 僅測試出這個

TOP

回復 1# john2006168
另外還有
If Worksheets("Main").Cells(2, 2).Value = "friendname" Then Worksheets(Worksheets.Count).Cells(2, 2).Value= "???"

TOP

回復 3# GBKEE


    If Worksheets("Main").Cells(i, 2).Value = friendname Then Worksheets(Worksheets.Count).Cells(i, 2).Value=friendname

TOP

        靜思自在 : 看別人不順眼,是自己修養不夠。
返回列表 上一主題