Hi experts! I've searched the old posts regarding this problem but I can't find the right fix. I have multiple worksheets with buttons and they keep resizing after I generated them in PDF forms. I've set the "Don't move or size with cells", placement property to 3 and tried to use this code which I found somewhere
So, I have a userform with print button. User then selects which worksheet to print as PDF, presses OK which triggers the FixButtons routine to fix the size.
But when I check the worksheet, the buttons changed its size and moved to the far top left side. Still not working! Please help.
Thanks in advance.
So, I have a userform with print button. User then selects which worksheet to print as PDF, presses OK which triggers the FixButtons routine to fix the size.
Code:
Sub FixButtons()
Dim wsname As String
Dim ws As Worksheet
Set ws = Worksheets("Lookup")
For i = 2 To 8
wsname = ws.Cells(i, 19)
'overnight- select button fix
Sheets(wsname).Shapes("cmdSelect").Top = 62
Sheets(wsname).Shapes("cmdSelect").Left = 699
Sheets(wsname).Shapes("cmdSelect").Width = 81
Sheets(wsname).Shapes("cmdSelect").Height = 22
Sheets(wsname).OLEObjects(1).Object.Font.Size = 10
'overnight- reorder button fix
Sheets(wsname).Shapes("cmdReorder").Top = 93
Sheets(wsname).Shapes("cmdReorder").Left = 699
Sheets(wsname).Shapes("cmdReorder").Width = 81
Sheets(wsname).Shapes("cmdReorder").Height = 22
Sheets(wsname).OLEObjects(2).Object.Font.Size = 10
Next i
End Sub
But when I check the worksheet, the buttons changed its size and moved to the far top left side. Still not working! Please help.
Thanks in advance.