Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 921
Default Vba - Picture Object naming

Hi,

I have a macro that copy's a range in the workbook to a picture.

1.) Copy's a range and saves as a picture

What I want to do - rename the picture object. I think it is named "Picture
1" or "Picture X" by default, but this is no good since I want to refer to it
later in the code.

Code:
Sub Create_picture()
'Create the picture
Worksheets("Pol Value").Range("A1:J50").CopyPicture xlScreen, xlBitmap

End sub

Thanks for your help


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,441
Default Vba - Picture Object naming

Jeff,

With Worksheets("Pol Value")
.Range("A1:J50").CopyPicture xlScreen, xlBitmap
.Paste Destination:=.Range("K1")
.Shapes(.Shapes.Count).Name = "NewPictureName"
End With

HTH,
Bernie
MS Excel MVP


"Jeff" wrote in message
...
Hi,

I have a macro that copy's a range in the workbook to a picture.

1.) Copy's a range and saves as a picture

What I want to do - rename the picture object. I think it is named "Picture
1" or "Picture X" by default, but this is no good since I want to refer to it
later in the code.

Code:
Sub Create_picture()
'Create the picture
Worksheets("Pol Value").Range("A1:J50").CopyPicture xlScreen, xlBitmap

End sub

Thanks for your help




  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Vba - Picture Object naming

Jeff,

When you paste it it is selected so immedialtly after pasting try this

Selection.Name = "MyPicture"

Mike

"Jeff" wrote:

Hi,

I have a macro that copy's a range in the workbook to a picture.

1.) Copy's a range and saves as a picture

What I want to do - rename the picture object. I think it is named "Picture
1" or "Picture X" by default, but this is no good since I want to refer to it
later in the code.

Code:
Sub Create_picture()
'Create the picture
Worksheets("Pol Value").Range("A1:J50").CopyPicture xlScreen, xlBitmap

End sub

Thanks for your help


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
Naming a chart object Jeff M Charts and Charting in Excel 6 September 23rd 08 06:00 AM
Changing a Picture or Object if a Cell equals a certain value Kevin Excel Discussion (Misc queries) 5 April 5th 07 11:58 AM
Cell value becomes filepath to insert picture,jpg or object Rookie_User Excel Worksheet Functions 0 February 6th 07 04:32 PM
Object vs Picture Handling in Different Versions of Excel Rif Excel Discussion (Misc queries) 0 October 9th 05 08:43 AM
Creating a picture/object David Rivera Excel Discussion (Misc queries) 1 July 16th 05 12:35 AM


All times are GMT +1. The time now is 03:56 PM.

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

About Us

"It's about Microsoft Excel"