Reputation: 1
I would like to tweak this code, so that it: - REPLACES all images with their AlternativeText - Runs for all worksheets in the workbook
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
Can you please think with me on this one? Thank you very much in advance!
Upvotes: 0
Views: 187
Reputation: 1195
To loop through all sheets in a workbook use:
For s = 1 to ActiveWorkbook.Worksheets.Count
Sheets(s).Activate
'Enter code to be run on each worksheet here
Next s
Upvotes: 1