我想调整这段代码,以便它: - 用AlternativeText替换所有图像 - 运行工作簿中的所有工作表
Dim Pic As Picture
Dim Cell As Range
For Each Pic In ActiveSheet.Pictures
Set Cell = Pic.TopLeftCell.Offset(, -1)
Do
If Cell.Value = "" Then
Cell.Value = Pic.ShapeRange.AlternativeText
Exit Do
Else
Set Cell = Cell.Offset(1)
End If
Loop
Next Pic
End Sub
你能和我一起思考吗?非常感谢你提前!
答案 0 :(得分:1)
要遍历工作簿中的所有工作表,请使用:
For s = 1 to ActiveWorkbook.Worksheets.Count
Sheets(s).Activate
'Enter code to be run on each worksheet here
Next s