Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I need to insert a picture into excel and then extract the numeric value from it's default name. For example, if you create a new workbook and insert a picture, the picture name will be "Picture 1". I need to extract the "1" from that name, so that I can assign it to the the starting value of a loop counter (don't ask...) TIA Paul |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Not sure what you really want, but here is some code to play with that lists
all the picture names and gives the number of the last picture. Sub test() List = "" Num = Sheets(1).Shapes.Count For i = 1 To Num List = List & Sheets(1).Shapes(i).Name & Chr(13) Next i MsgBox List MsgBox Right(Sheets(1).Shapes(Num).Name, Len(Sheets(1).Shapes(Num).Name) - 7) End Sub HTH, Greg "Paul" wrote in message ... Hi, I need to insert a picture into excel and then extract the numeric value from it's default name. For example, if you create a new workbook and insert a picture, the picture name will be "Picture 1". I need to extract the "1" from that name, so that I can assign it to the the starting value of a loop counter (don't ask...) TIA Paul |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
One way:
This returns the number of the last pic (or -1 if none) inserted: Public Function LastPicNum() As Long Dim sName As String With ActiveSheet.Pictures If .Count 0 Then sName = .Item(.Count).Name LastPicNum = CLng(Mid(sName, InStr(sName, " ") + 1)) Else LastPicNum = -1 End If End With End Function In article , "Paul" wrote: Hi, I need to insert a picture into excel and then extract the numeric value from it's default name. For example, if you create a new workbook and insert a picture, the picture name will be "Picture 1". I need to extract the "1" from that name, so that I can assign it to the the starting value of a loop counter (don't ask...) TIA Paul |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Connect a number to a picture bank and import that picture to exce | Excel Discussion (Misc queries) | |||
how do I insert picture into cell so vlookup can return picture? | Excel Worksheet Functions | |||
insert a picture in to a comment but picture not save on hard disk | Excel Discussion (Misc queries) | |||
How to extract a picture from an Excel worksheet into a picture fi | Excel Discussion (Misc queries) | |||
new user with easy question? not easy for me | New Users to Excel |