Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 210
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 210
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default 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
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
Storing Clip Art pictures in My Pictures folder jfg Excel Discussion (Misc queries) 4 August 10th 07 06:12 AM
Hyperlink Removal lsmft Excel Discussion (Misc queries) 3 February 23rd 06 10:23 AM
Excel's Compress Pictures or deleting pictures doesn't seem work guidod Excel Discussion (Misc queries) 1 January 29th 06 06:51 AM
Sheet removal...help please Terry Excel Discussion (Misc queries) 2 July 19th 05 11:12 PM
adding pictures to an excel file that are on a cd dogisnuts Excel Discussion (Misc queries) 1 April 27th 05 11:29 AM


All times are GMT +1. The time now is 06:27 AM.

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"