Dear Friends,
In this macro I want to resize picture in same size. The macro is not giving any error but also not giving required output. Please solve my problem. The code is as follows:
Sub ResizePicing()
Dim pic As Object, N As String, ws As Worksheet, R As Range, T As Single
Set ws = ActiveSheet: ws.Range("g:g").ColumnWidth = 15.43: T = 10
For Each pic In ws.Shapes
If pic.Type = msoPicture Then
If Abs(pic.Left - Range("g1").Left) < T Then
N = pic.Name
If InStr(1, N, "Butt") Then GoTo GetNext
pic.LockAspectRatio = msoFalse
pic.Width = Application.CentimetersToPoints(1.85)
pic.Height = Application.CentimetersToPoints(2.38)
For Each R In Range("g1:g" & Range("B" & Rows.Count).End(xlUp).Row)
If Abs(pic.Top - R.Top) < T And Abs(pic.Left - R.Left) < T Then
pic.Left = R.Left: pic.Top = R.Top: R.RowHeight = pic.Height
Exit For: End If: Next: End If: End If
GetNext: Next pic
End Sub
Thanking you in anticipation.
Mukesh
Bookmarks