phamvandunghp84
Thành viên thường trực
- Tham gia
- 5/3/20
- Bài viết
- 241
- Được thích
- 12
tự nhiên bị não cá vàng nên rối quá, có bác nào giúp em sửa chút:
Sub doilaitenchodungvitri()
Dim i As Integer
Dim j As Integer
Dim vtrtop As Long
Dim ten As String
Dim bien As Long
For i = 1 To 741
j = 0
With Worksheets("Sheet3")
bien = .ChartObjects("Chart " & i).top
If bien <> Sheets("Sheet4").Cells(i + 1, 14) Then
For j = 1 To 741
If bien = Sheets("Sheet4").Cells(j + 1, 14) Then
ten = Sheets("Sheet4").Cells(j + 1, 16) ' ten Chart
ActiveSheet.ChartObjects(i).Name = ten
MsgBox ("dang doi ten chart co vi tri o man hinh " & bien & vbNewLine & " ten chart cu la Chart " & i & vbNewLine & " Ten chart moi la " & ten)
Else
Next j
End If
Else
Next i
End With
End Sub
Sub doilaitenchodungvitri()
Dim i As Integer
Dim j As Integer
Dim vtrtop As Long
Dim ten As String
Dim bien As Long
For i = 1 To 741
j = 0
With Worksheets("Sheet3")
bien = .ChartObjects("Chart " & i).top
If bien <> Sheets("Sheet4").Cells(i + 1, 14) Then
For j = 1 To 741
If bien = Sheets("Sheet4").Cells(j + 1, 14) Then
ten = Sheets("Sheet4").Cells(j + 1, 16) ' ten Chart
ActiveSheet.ChartObjects(i).Name = ten
MsgBox ("dang doi ten chart co vi tri o man hinh " & bien & vbNewLine & " ten chart cu la Chart " & i & vbNewLine & " Ten chart moi la " & ten)
Else
Next j
End If
Else
Next i
End With
End Sub