M
Monshi
Trying to smoothly copy a range of cells as a picture and temporarily show it
on another sheet in the workbook.
Is it possible to place it at the time of copy? I have found two ways to
postition the image:
1: Select a cell before paste, upper left corner of picture will be placed
at cell. cumebersome since I want to center the image on an object in the
worksheet.
2: Paste the picture and afterwards set the top and the left of the picture.
This causes the image to jump on the sheet. Can use
Application.ScreenUpdating to hide the jump but then Excel flickers.
My code:
Private myPic As Excel.Picture
Range("rnTryCpy").Copy
Set myPic = Sheets("Blad1").Pictures.Paste
Place:
(before paste)
WorkSheets("Blad1").Range("p15").Select
or
(after paste)
myPic.Left = WorkSheets("Blad1").Range("p15").Left - myPic.Width / 2
myPic.Top = WorkSheets("Blad1").Range("p16").Top
It is not always range P15 I want to center to, in actual the center is
provided at the call to the function which do the copy.
Is there a way to specify the paste position other than those two?
And WHY is part of help in VBA-editor hidden? Hidden Language Element? Why?
Pls
on another sheet in the workbook.
Is it possible to place it at the time of copy? I have found two ways to
postition the image:
1: Select a cell before paste, upper left corner of picture will be placed
at cell. cumebersome since I want to center the image on an object in the
worksheet.
2: Paste the picture and afterwards set the top and the left of the picture.
This causes the image to jump on the sheet. Can use
Application.ScreenUpdating to hide the jump but then Excel flickers.
My code:
Private myPic As Excel.Picture
Range("rnTryCpy").Copy
Set myPic = Sheets("Blad1").Pictures.Paste
Place:
(before paste)
WorkSheets("Blad1").Range("p15").Select
or
(after paste)
myPic.Left = WorkSheets("Blad1").Range("p15").Left - myPic.Width / 2
myPic.Top = WorkSheets("Blad1").Range("p16").Top
It is not always range P15 I want to center to, in actual the center is
provided at the call to the function which do the copy.
Is there a way to specify the paste position other than those two?
And WHY is part of help in VBA-editor hidden? Hidden Language Element? Why?
Pls