Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Place a picture at copy

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Place a picture at copy

Ok, just learned hidden elemenets are deprectade elements...
So instead I use Shape, I copy the range as a shape and pastes it to the
other sheet.

Thw bigg Q now is how do I adress the new shape. When pasting only
True/False is returned, no referens to the shape. How do I find the shape I
just pasted?


"Monshi" wrote:

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Place a picture at copy

Just learned hidden language elements are deprecated elements... Instead of
picture I now use Shape. I copy the range as an image and pastes is as a
shape.

The only problem now is how do I find a reference to the new shape on the
sheet? Paste operation only returns True or False, no help there.

Yours


"Monshi" wrote:

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
zz zz is offline
external usenet poster
 
Posts: 32
Default Place a picture at copy

you could create a variable, let's say NewShapeName and assing it the value
of the name of your recently pasted shape

then when you need to use your shape's name you would do somethin like this

sheets("Blad1").shapes(NewShapeName).top= 300



"Monshi" wrote in message
...
Just learned hidden language elements are deprecated elements... Instead
of
picture I now use Shape. I copy the range as an image and pastes is as a
shape.

The only problem now is how do I find a reference to the new shape on the
sheet? Paste operation only returns True or False, no help there.

Yours


"Monshi" wrote:

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



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Place a picture at copy

Thanks for the reply.
The problem is to identify wich shape I have added to the sheet, I don't
know the name of the shape. How could I know the name?

I have found that that the last added shape is the last shape found in the
collection Shapes (quite logical), i.e.
Set myPic = Sheets("mySheet").Shapes(Sheets("mySheet").Shapes. Count))
sets myPic to the shape I have just added to the sheet.

But still - not the way I would like to go to find the shape, should be able
to adress it directly.

Placing the shape once I have a refernce to it is no problem.

And - sorry about the double post.

/T
"zz" wrote:

you could create a variable, let's say NewShapeName and assing it the value
of the name of your recently pasted shape

then when you need to use your shape's name you would do somethin like this

sheets("Blad1").shapes(NewShapeName).top= 300



"Monshi" wrote in message
...
Just learned hidden language elements are deprecated elements... Instead
of
picture I now use Shape. I copy the range as an image and pastes is as a
shape.

The only problem now is how do I find a reference to the new shape on the
sheet? Paste operation only returns True or False, no help there.

Yours


"Monshi" wrote:

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




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How Do I Place a Picture Behind Cells Jon Excel Discussion (Misc queries) 2 January 29th 07 08:16 PM
Place picture behind text frivoniss Excel Discussion (Misc queries) 1 February 2nd 06 04:36 PM
place picture Pierre via OfficeKB.com[_2_] Excel Programming 1 November 8th 05 03:15 PM
How can I place text infront of a picture? mr.Caish Excel Discussion (Misc queries) 1 February 23rd 05 10:13 PM
copy charts & paste as picture, hide chart, size & place same picture as chart Gunnar Johansson Excel Programming 0 October 30th 04 01:22 AM


All times are GMT +1. The time now is 11:23 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"