nniedzielski
Well-known Member
- Joined
- Jan 8, 2016
- Messages
- 598
- Office Version
- 2019
- Platform
- Windows
I am running this, which is taking a screen shot, pasting, resizing, but I use two monitors, and it pastes both monitors screen shot on the page, and i want to crop off the right side,
When i run the last three lines of code, it doesn't crop anything off, it just makes the image smaller,
how can i tell excel to crop the right side off to a certain size?
VBA Code:
Application.SendKeys "({1068})", True
DoEvents
Sheets("Screen Shots").Paste
Dim shp As Shape
With ActiveSheet
Set shp = .Shapes(.Shapes.Count)
End With
shp.Height = 600
shp.Width = 800
Dim h As Single, w As Single
h = -(600 - shp.Height)
w = -(1200 - shp.Width)
shp.LockAspectRatio = False
shp.PictureFormat.CropRight = w
shp.PictureFormat.CropBottom = h
When i run the last three lines of code, it doesn't crop anything off, it just makes the image smaller,
how can i tell excel to crop the right side off to a certain size?