Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to use the content of a cell as a file name
I Like to have a macro that looks at the content of a specific cell in the
sheet to get the file name neede to insert the picture in a specific cell. This would be same function for all the sheets except sheet(cover). Here is the recorded macro: ActiveSheet.Unprotect Range("E2:H18").Select ActiveSheet.Pictures.Insert( _ """" this is where I want to unsert the cell that has file name"""' "C:\Documents and Settings\Vince Aragona\My Documents\My Pictures\101MSDCF\101MSDCF\DSC00002.JPG" _ ).Select Selection.ShapeRange.LockAspectRatio = msoTrue Selection.ShapeRange.Height = 216# Selection.ShapeRange.Width = 288# Selection.ShapeRange.Rotation = 0# Any help would be greatly appreciated. -- CY |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to use the content of a cell as a file name
http://www.mcgimpsey.com/excel/lookuppics.html
If that isn't exactly what you want, it should give you all the information you need. if you want your simplified code: ActiveSheet.Unprotect Range("E2:H18").Select sName = Worksheets("Sheet1").Range("A1").Text ActiveSheet.Pictures.Insert(s).Select Selection.ShapeRange.LockAspectRatio = msoTrue Selection.ShapeRange.Height = 216# Selection.ShapeRange.Width = 288# Selection.ShapeRange.Rotation = 0# -- regards, Tom Ogilvy "cyrus" wrote in message ... I Like to have a macro that looks at the content of a specific cell in the sheet to get the file name neede to insert the picture in a specific cell. This would be same function for all the sheets except sheet(cover). Here is the recorded macro: ActiveSheet.Unprotect Range("E2:H18").Select ActiveSheet.Pictures.Insert( _ """" this is where I want to unsert the cell that has file name"""' "C:\Documents and Settings\Vince Aragona\My Documents\My Pictures\101MSDCF\101MSDCF\DSC00002.JPG" _ ).Select Selection.ShapeRange.LockAspectRatio = msoTrue Selection.ShapeRange.Height = 216# Selection.ShapeRange.Width = 288# Selection.ShapeRange.Rotation = 0# Any help would be greatly appreciated. -- CY |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to use the content of a cell as a file name
Tom,
I'm so close to getting this right but not there yet. I tried your code and I get this message" Unable to get the property of the pictures class" My thinking is that I have the wrong file name in the cell. but checked and double checked. I even ran the recorded macro to see the exact file and it maches with my cell. Any ideas? ActiveSheet.Unprotect Range("E2:H18").Select sName = Worksheets("3").Range("G43").Text ActiveSheet.Pictures.Insert(s).Select """ this is highlighted"""" Selection.ShapeRange.LockAspectRatio = msoTrue Selection.ShapeRange.Height = 216# Selection.ShapeRange.Width = 288# Selection.ShapeRange.Rotation = 0# -- CY "Tom Ogilvy" wrote: http://www.mcgimpsey.com/excel/lookuppics.html If that isn't exactly what you want, it should give you all the information you need. if you want your simplified code: ActiveSheet.Unprotect Range("E2:H18").Select sName = Worksheets("Sheet1").Range("A1").Text ActiveSheet.Pictures.Insert(s).Select Selection.ShapeRange.LockAspectRatio = msoTrue Selection.ShapeRange.Height = 216# Selection.ShapeRange.Width = 288# Selection.ShapeRange.Rotation = 0# -- regards, Tom Ogilvy "cyrus" wrote in message ... I Like to have a macro that looks at the content of a specific cell in the sheet to get the file name neede to insert the picture in a specific cell. This would be same function for all the sheets except sheet(cover). Here is the recorded macro: ActiveSheet.Unprotect Range("E2:H18").Select ActiveSheet.Pictures.Insert( _ """" this is where I want to unsert the cell that has file name"""' "C:\Documents and Settings\Vince Aragona\My Documents\My Pictures\101MSDCF\101MSDCF\DSC00002.JPG" _ ).Select Selection.ShapeRange.LockAspectRatio = msoTrue Selection.ShapeRange.Height = 216# Selection.ShapeRange.Width = 288# Selection.ShapeRange.Rotation = 0# Any help would be greatly appreciated. -- CY |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to use the content of a cell as a file name
A typo.
Try: ActiveSheet.Pictures.Insert(sName).Select cyrus wrote: Tom, I'm so close to getting this right but not there yet. I tried your code and I get this message" Unable to get the property of the pictures class" My thinking is that I have the wrong file name in the cell. but checked and double checked. I even ran the recorded macro to see the exact file and it maches with my cell. Any ideas? ActiveSheet.Unprotect Range("E2:H18").Select sName = Worksheets("3").Range("G43").Text ActiveSheet.Pictures.Insert(s).Select """ this is highlighted"""" Selection.ShapeRange.LockAspectRatio = msoTrue Selection.ShapeRange.Height = 216# Selection.ShapeRange.Width = 288# Selection.ShapeRange.Rotation = 0# -- CY "Tom Ogilvy" wrote: http://www.mcgimpsey.com/excel/lookuppics.html If that isn't exactly what you want, it should give you all the information you need. if you want your simplified code: ActiveSheet.Unprotect Range("E2:H18").Select sName = Worksheets("Sheet1").Range("A1").Text ActiveSheet.Pictures.Insert(s).Select Selection.ShapeRange.LockAspectRatio = msoTrue Selection.ShapeRange.Height = 216# Selection.ShapeRange.Width = 288# Selection.ShapeRange.Rotation = 0# -- regards, Tom Ogilvy "cyrus" wrote in message ... I Like to have a macro that looks at the content of a specific cell in the sheet to get the file name neede to insert the picture in a specific cell. This would be same function for all the sheets except sheet(cover). Here is the recorded macro: ActiveSheet.Unprotect Range("E2:H18").Select ActiveSheet.Pictures.Insert( _ """" this is where I want to unsert the cell that has file name"""' "C:\Documents and Settings\Vince Aragona\My Documents\My Pictures\101MSDCF\101MSDCF\DSC00002.JPG" _ ).Select Selection.ShapeRange.LockAspectRatio = msoTrue Selection.ShapeRange.Height = 216# Selection.ShapeRange.Width = 288# Selection.ShapeRange.Rotation = 0# Any help would be greatly appreciated. -- CY -- Dave Peterson |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to use the content of a cell as a file name
It's funny how how a four letter word can change everything! You just saved
me a bunch time. Thank you so much Regards, -- CY "Dave Peterson" wrote: A typo. Try: ActiveSheet.Pictures.Insert(sName).Select cyrus wrote: Tom, I'm so close to getting this right but not there yet. I tried your code and I get this message" Unable to get the property of the pictures class" My thinking is that I have the wrong file name in the cell. but checked and double checked. I even ran the recorded macro to see the exact file and it maches with my cell. Any ideas? ActiveSheet.Unprotect Range("E2:H18").Select sName = Worksheets("3").Range("G43").Text ActiveSheet.Pictures.Insert(s).Select """ this is highlighted"""" Selection.ShapeRange.LockAspectRatio = msoTrue Selection.ShapeRange.Height = 216# Selection.ShapeRange.Width = 288# Selection.ShapeRange.Rotation = 0# -- CY "Tom Ogilvy" wrote: http://www.mcgimpsey.com/excel/lookuppics.html If that isn't exactly what you want, it should give you all the information you need. if you want your simplified code: ActiveSheet.Unprotect Range("E2:H18").Select sName = Worksheets("Sheet1").Range("A1").Text ActiveSheet.Pictures.Insert(s).Select Selection.ShapeRange.LockAspectRatio = msoTrue Selection.ShapeRange.Height = 216# Selection.ShapeRange.Width = 288# Selection.ShapeRange.Rotation = 0# -- regards, Tom Ogilvy "cyrus" wrote in message ... I Like to have a macro that looks at the content of a specific cell in the sheet to get the file name neede to insert the picture in a specific cell. This would be same function for all the sheets except sheet(cover). Here is the recorded macro: ActiveSheet.Unprotect Range("E2:H18").Select ActiveSheet.Pictures.Insert( _ """" this is where I want to unsert the cell that has file name"""' "C:\Documents and Settings\Vince Aragona\My Documents\My Pictures\101MSDCF\101MSDCF\DSC00002.JPG" _ ).Select Selection.ShapeRange.LockAspectRatio = msoTrue Selection.ShapeRange.Height = 216# Selection.ShapeRange.Width = 288# Selection.ShapeRange.Rotation = 0# Any help would be greatly appreciated. -- CY -- Dave Peterson |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to use the content of a cell as a file name
Dave, Tom
Sorry to bug you. I left out one minor detail. In need to do this for every sheet except sheet named(Cover). All the formula cells and cells for Pic insertions are the same range for every sheet. Thanks a million -- CY "Dave Peterson" wrote: A typo. Try: ActiveSheet.Pictures.Insert(sName).Select cyrus wrote: Tom, I'm so close to getting this right but not there yet. I tried your code and I get this message" Unable to get the property of the pictures class" My thinking is that I have the wrong file name in the cell. but checked and double checked. I even ran the recorded macro to see the exact file and it maches with my cell. Any ideas? ActiveSheet.Unprotect Range("E2:H18").Select sName = Worksheets("3").Range("G43").Text ActiveSheet.Pictures.Insert(s).Select """ this is highlighted"""" Selection.ShapeRange.LockAspectRatio = msoTrue Selection.ShapeRange.Height = 216# Selection.ShapeRange.Width = 288# Selection.ShapeRange.Rotation = 0# -- CY "Tom Ogilvy" wrote: http://www.mcgimpsey.com/excel/lookuppics.html If that isn't exactly what you want, it should give you all the information you need. if you want your simplified code: ActiveSheet.Unprotect Range("E2:H18").Select sName = Worksheets("Sheet1").Range("A1").Text ActiveSheet.Pictures.Insert(s).Select Selection.ShapeRange.LockAspectRatio = msoTrue Selection.ShapeRange.Height = 216# Selection.ShapeRange.Width = 288# Selection.ShapeRange.Rotation = 0# -- regards, Tom Ogilvy "cyrus" wrote in message ... I Like to have a macro that looks at the content of a specific cell in the sheet to get the file name neede to insert the picture in a specific cell. This would be same function for all the sheets except sheet(cover). Here is the recorded macro: ActiveSheet.Unprotect Range("E2:H18").Select ActiveSheet.Pictures.Insert( _ """" this is where I want to unsert the cell that has file name"""' "C:\Documents and Settings\Vince Aragona\My Documents\My Pictures\101MSDCF\101MSDCF\DSC00002.JPG" _ ).Select Selection.ShapeRange.LockAspectRatio = msoTrue Selection.ShapeRange.Height = 216# Selection.ShapeRange.Width = 288# Selection.ShapeRange.Rotation = 0# Any help would be greatly appreciated. -- CY -- Dave Peterson |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to use the content of a cell as a file name
Dim wks as worksheet
for each wks in activeworkbook.worksheets with wks select case lcase(.name) case is = "cover" 'do nothing case else .select .Range("E2:H18").Select sName = .Range("A1").Text .Pictures.Insert(sName).Select Selection.ShapeRange.LockAspectRatio = msoTrue Selection.ShapeRange.Height = 216# Selection.ShapeRange.Width = 288# Selection.ShapeRange.Rotation = 0# end select end with next wks Maybe??????? cyrus wrote: Dave, Tom Sorry to bug you. I left out one minor detail. In need to do this for every sheet except sheet named(Cover). All the formula cells and cells for Pic insertions are the same range for every sheet. Thanks a million -- CY "Dave Peterson" wrote: A typo. Try: ActiveSheet.Pictures.Insert(sName).Select cyrus wrote: Tom, I'm so close to getting this right but not there yet. I tried your code and I get this message" Unable to get the property of the pictures class" My thinking is that I have the wrong file name in the cell. but checked and double checked. I even ran the recorded macro to see the exact file and it maches with my cell. Any ideas? ActiveSheet.Unprotect Range("E2:H18").Select sName = Worksheets("3").Range("G43").Text ActiveSheet.Pictures.Insert(s).Select """ this is highlighted"""" Selection.ShapeRange.LockAspectRatio = msoTrue Selection.ShapeRange.Height = 216# Selection.ShapeRange.Width = 288# Selection.ShapeRange.Rotation = 0# -- CY "Tom Ogilvy" wrote: http://www.mcgimpsey.com/excel/lookuppics.html If that isn't exactly what you want, it should give you all the information you need. if you want your simplified code: ActiveSheet.Unprotect Range("E2:H18").Select sName = Worksheets("Sheet1").Range("A1").Text ActiveSheet.Pictures.Insert(s).Select Selection.ShapeRange.LockAspectRatio = msoTrue Selection.ShapeRange.Height = 216# Selection.ShapeRange.Width = 288# Selection.ShapeRange.Rotation = 0# -- regards, Tom Ogilvy "cyrus" wrote in message ... I Like to have a macro that looks at the content of a specific cell in the sheet to get the file name neede to insert the picture in a specific cell. This would be same function for all the sheets except sheet(cover). Here is the recorded macro: ActiveSheet.Unprotect Range("E2:H18").Select ActiveSheet.Pictures.Insert( _ """" this is where I want to unsert the cell that has file name"""' "C:\Documents and Settings\Vince Aragona\My Documents\My Pictures\101MSDCF\101MSDCF\DSC00002.JPG" _ ).Select Selection.ShapeRange.LockAspectRatio = msoTrue Selection.ShapeRange.Height = 216# Selection.ShapeRange.Width = 288# Selection.ShapeRange.Rotation = 0# Any help would be greatly appreciated. -- CY -- Dave Peterson -- Dave Peterson |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to use the content of a cell as a file name
Tom,
That worked Great. Thanks again, -- CY "cyrus" wrote: I Like to have a macro that looks at the content of a specific cell in the sheet to get the file name neede to insert the picture in a specific cell. This would be same function for all the sheets except sheet(cover). Here is the recorded macro: ActiveSheet.Unprotect Range("E2:H18").Select ActiveSheet.Pictures.Insert( _ """" this is where I want to unsert the cell that has file name"""' "C:\Documents and Settings\Vince Aragona\My Documents\My Pictures\101MSDCF\101MSDCF\DSC00002.JPG" _ ).Select Selection.ShapeRange.LockAspectRatio = msoTrue Selection.ShapeRange.Height = 216# Selection.ShapeRange.Width = 288# Selection.ShapeRange.Rotation = 0# Any help would be greatly appreciated. -- CY |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
HDI set cell content as the default file name for a new Excel wb | Excel Discussion (Misc queries) | |||
link cell content to another file | Excel Discussion (Misc queries) | |||
Assign Cell Content As File Name | Excel Programming | |||
Save as using cell content in file name | Excel Programming | |||
Automatic File Name based on cell content | Excel Programming |