Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Naming a chart object | Charts and Charting in Excel | |||
Changing a Picture or Object if a Cell equals a certain value | Excel Discussion (Misc queries) | |||
Cell value becomes filepath to insert picture,jpg or object | Excel Worksheet Functions | |||
Object vs Picture Handling in Different Versions of Excel | Excel Discussion (Misc queries) | |||
Creating a picture/object | Excel Discussion (Misc queries) |