Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Pictures adding & removal
Hi,
I use a vba-button and function to add logos in a worksheet. Everytime I use this button, the old logo is being overwritten by a new one. I need to change the code so that the old logo is deleted before the new one is placed. Suggestions? Thnx |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Pictures adding & removal
Post your code.
-- Gary''s Student - gsnu200749 "Robin" wrote: Hi, I use a vba-button and function to add logos in a worksheet. Everytime I use this button, the old logo is being overwritten by a new one. I need to change the code so that the old logo is deleted before the new one is placed. Suggestions? Thnx |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Pictures adding & removal
Public Sub SorteerAlleTeams1() 'op basis van clubs
Range("D3:K107").Select Selection.Sort Key1:=Range("D3"), _ Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom Dim r As Integer r = 3 'ga naar regel 3 Do Until Cells(r, 13).Value = "" 'totdat er niets meer staat in cel (r,13) With ActiveSheet.Pictures.Insert( _ ThisWorkbook.Path & "\Logo's\" & Cells(r, 13).Value) '"\" geeft aan dat de plaaatjes 1 map hoger staan .Top = Cells(r, 13).Top 'plaats waar de waarde van het logo gelezen wordt .Left = Cells(r, 14).Left 'plaats waar het logo terecht moet komen .Width = (.Width / .Height) * Cells(r, 13).Height .Height = Cells(r, 13).Height End With r = r + 1 'ga een regel verder Loop 'doe opnieuw Dim i As Integer i = 3 Do Until Cells(i, 13).Value = "" With ActiveSheet.Pictures.Insert( _ ThisWorkbook.Path & "\" & Cells(i, 13).Value) .Top = Cells(i, 13).Top .Left = Cells(i, 14).Left .Width = (.Width / .Height) * Cells(i, 13).Height .Height = Cells(i, 13).Height End With i = i + 1 Loop Range("A1").Select End Sub "Gary''s Student" wrote: Post your code. -- Gary''s Student - gsnu200749 "Robin" wrote: Hi, I use a vba-button and function to add logos in a worksheet. Everytime I use this button, the old logo is being overwritten by a new one. I need to change the code so that the old logo is deleted before the new one is placed. Suggestions? Thnx |
#4
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Pictures adding & removal
Include a line like:
ActiveSheet.Pictures.Delete near the top of your code. -- Gary''s Student - gsnu200749 "Robin" wrote: Public Sub SorteerAlleTeams1() 'op basis van clubs Range("D3:K107").Select Selection.Sort Key1:=Range("D3"), _ Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom Dim r As Integer r = 3 'ga naar regel 3 Do Until Cells(r, 13).Value = "" 'totdat er niets meer staat in cel (r,13) With ActiveSheet.Pictures.Insert( _ ThisWorkbook.Path & "\Logo's\" & Cells(r, 13).Value) '"\" geeft aan dat de plaaatjes 1 map hoger staan .Top = Cells(r, 13).Top 'plaats waar de waarde van het logo gelezen wordt .Left = Cells(r, 14).Left 'plaats waar het logo terecht moet komen .Width = (.Width / .Height) * Cells(r, 13).Height .Height = Cells(r, 13).Height End With r = r + 1 'ga een regel verder Loop 'doe opnieuw Dim i As Integer i = 3 Do Until Cells(i, 13).Value = "" With ActiveSheet.Pictures.Insert( _ ThisWorkbook.Path & "\" & Cells(i, 13).Value) .Top = Cells(i, 13).Top .Left = Cells(i, 14).Left .Width = (.Width / .Height) * Cells(i, 13).Height .Height = Cells(i, 13).Height End With i = i + 1 Loop Range("A1").Select End Sub "Gary''s Student" wrote: Post your code. -- Gary''s Student - gsnu200749 "Robin" wrote: Hi, I use a vba-button and function to add logos in a worksheet. Everytime I use this button, the old logo is being overwritten by a new one. I need to change the code so that the old logo is deleted before the new one is placed. Suggestions? Thnx |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Storing Clip Art pictures in My Pictures folder | Excel Discussion (Misc queries) | |||
Hyperlink Removal | Excel Discussion (Misc queries) | |||
Excel's Compress Pictures or deleting pictures doesn't seem work | Excel Discussion (Misc queries) | |||
Sheet removal...help please | Excel Discussion (Misc queries) | |||
adding pictures to an excel file that are on a cd | Excel Discussion (Misc queries) |