Free Microsoft Excel 2013 Quick Reference

Cannot Delete A Pasted Picture.

I need to find a way to delete picture that I pasting into an excel spreadsheet
having some charts on it.
I’m using VBA to snapshot to picture and pasting it into the Excel spreadsheet,
but when I want to delete it, the picture changes its identification number i.e.
“picture 35” then “picture 36” and so on, thus I can’t force the delete command to
target the picture.
Is their way to assign a fix namenumber to the pasted picture that will stay with it,
and allow me to use it later for deleting?

Lot of Thanks

Post your answer or comment

comments powered by Disqus
I have a spreadsheet where there is a white line that is over a row line. No matter what I do I cannot seem to delete it.

I zoom in but I cannot select it.

I change the border of the cells and it will not disappear.

I am completely lost as to what else it could be, no doubt it is a simple answer that is staring me in the face. I inherited the spreadsheet so not sure what was done in the past...

Any tips please let me know.

I'm deleting a picture from an Excel sheet, pasting a new picture in and saving. Each time I do this the file size increases more and more. I've been using the most recently saved sheet each time and now all the sheets I have saved today are upwards of 3 MB each.

Any ideas why this might be?

I've verified that sharing is off on the sheets. I even turned it on and back off to see if that changed anything. I looked at the clipboard, nothing saves with the files. I compressed the pictures that are in the files but no change.

Thanks for any help,


I have a small macro that inserts a picture to the worksheet based upon a user selected droplist. It's as follows:

Private Sub Worksheet_Change(ByVal Target As Range)
'    M8 is the cell that contains the following trimmed text
'     "c:program filesdalllcliquorimagespatron-anejo.jpg"

      Dim TheFile As String
      Dim Results As String
      DIM img As String
      TheFile = Range("M8")
      Results = Dir$(TheFile)
      If Results = "" Then
         img = "c:program filesdalllcliquorimagespicnotfound.gif"
         img = Range("m8")
      End If
End Sub
The problem I have is that if the user changes the selection on the drop list, the new picture displays just fine, however it simply overlays the existing picture..

How do I delete the existing picture first ? I tried a simple recorded macro, but I noticed that it changes the picture ID every time one is displayed..
ie Code:
     ActiveSheet.Shapes("Picture 64").Select
How would I capture that PICTURE 64, 65, etc automatically ??

Any help is always appreciated....

Is there a way to paste a .jpg picture in a cell so that it can be sorted with other items in that row? It seems that the photo I insert is just over the cells, not in a cell, and it doesn't move when the other collumns are sorted.


Hello all,

I am having a really hard time deleting an excel file that is located on a
windows 2k3 cluster. The client is xp pro. the excel file contained macros
and had multiple sheet and most of them were protected. I first copied all
sheets and pasted special (values only) and then I deleted all the sheet and
left only a blank sheet. I saved the file. then i tried to delete it but i
get an error:

Cannot delete : It is being used by another person or program.
Close any programs that might be using the file and try again.

I ran oh.exe and the file was not listed as being locked. I downloaded
WhoLockedMe.exe and that utilied didnt show the file being locked either. I
also tried a util called delinvfile.exe to delete it but that didnt work

Has anyone ran across this problem? If so, how did you resolve it?

I appreciate any information anyone has on deleting this file.


I have a data spreadhseet fitted to one landscape page. However when I print,
there is always a second page with one single blank column. No matter how I
try to delete that single column, I cannot. Suggestions please?

I am using Microsoft Office 2003 on a Toshiba notebook Tecra S-1

On Jun 11, 11:58 pm, "Rob L" >
> I have a spreadsheet (used for tracking inductions), and have one sheet set
> up to print an ID Card for people. On another sheet, I have pictures of all
> the people who have been inducted (yes, I know it would be better to use a
> database, or to link the pictures rather than having them stored in the
> sheet, but for various reason, can't do that). The pictures are all named
> ie. JohnSmith01, PeterWilliams01, JohnSmith02 etc.
> How do I type a picture name in a cell on the ID Card sheet, and have that
> persons picture appear on the card. Alternately, how do I select a picture
> by name, ie. GoTo>MikeBrown01 ?
> Thanks
> Rob

Maybe something like...

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("A1")) Is Nothing Then
Dim Shp As Shape
On Error GoTo PictureNotFound
Worksheets("Sheet2").Shapes(Me.Range("A1").Value). Copy
'Delete the previous picture
For Each Shp In Me.Shapes
If Shp.Type = msoPicture Then
If Shp.TopLeftCell.Address = "$C$1" Then
If Shp.Name Range("A1").Value Then Shp.Delete
End If
End If
With Selection
.Name = Range("A1").Value
.Top = Range("C1").Top
.Left = Range("C1").Left
End With
Exit Sub
PictureNotFound: MsgBox "Picture not found!" & vbNewLine _
& "Check Name."
End If
End Sub

All pictures are on Sheet2.
The name of the picture to be shown on Sheet1 is typed into Sheet1 A1
and the code positions it on Sheet1 so that its top left corner is the
top left corner of C1. Just change the sheet names and cell addresses
to suit your needs.
The code needs to be pasted into the code module of the sheet showing
the chosen picture.

Ken Johnson

I have the followint formula in a conditional format.
I remember getting it from this group, it highlights the active cell in
I cannot delete it and I believe it will not allow me to copy and paste
data about the spreadsheet.
I need to delete as I need to copy and paste more than I need the
active cell highlighted.

i recently installed an office 2007 update, and now i cannot paste pictures
from excel worksheets without gridlines and comment boxes showing. In the
past, gridlines would show in excel, but when you pasted to a word document
they would go away along with red comment box markers. Now i can't get them
to go.

Just installed Office 2010.
When I press PrintScrn or ALT+PrintScrn >> move to an open WB and try to Paste the picture (which is, probably, located in the Comp. Clipboard) into whatever sheet -
I get this error:"Microsoft Excel cannot paste the data".
Pasting into a "Word" Document works like charm.
More than that - when I copy that pasted picture (from inside the document) it "agrees" to be pasted onto the WB Sheet.
Does anybody any clue ?
I am aware that the 2010 is a fresh beta version, "still warm from the oven", but maybe one of you faces a similar problem in one of the previous versions.

I used the "Paste Picture Link" function in Excel to paste a range of cells to another location in my spreadsheet. It has been working fine (I could select the "picture" of the range, and drag it around just like it is supposed to work). Now, I cannot select the "picture". And, if I try to use the "Paste Picture Link" again in the same worksheet, the option is greyed out. Any ideas on why the option would stop working/become unavailable?

Thanks in advance!!

Hi Guys,

I have a number of charts which are pasted on a sheet as pictures. I want to open a 'new document' in Word and paste all pictures in that document. When the user closes the word file it would be nice that a 'Save As' screen opens with a default directory "C:QRA Model *.doc".

If I select them all and paste to Word - they will appear as one picture and I need them one below another so they have to be pasted one by one - one below another (with the size of each picture fitting the page width - i.e. some times these pictures come wider than the page).

In earlier threads I found this code which seems to be similar to what I want but it deals with a range not with a shape/picture?

    Dim wdApp As Object 
    Dim wd As Object 
    On Error Resume Next 
    Set wdApp = GetObject(, "Word.Application") 
    If Err.Number  0 Then 
        Set wdApp = CreateObject("Word.Application") 
    End If 
    On Error Goto 0 
     'the following statement opens a specific doc and I want a new one?
    Set wd = wdApp.Documents.Open("C:testtest.doc") 
    wdApp.Visible = True 
    Range("A1:E10").CopyPicture xlScreen, xlPicture 
End Sub 

If you like these VB formatting tags please consider sponsoring the author in support of injured Royal Marines
For moderators: In one of the earlier threads I found that 'the thread was moved to Word/Excel' forum? I can't find it, is that still the same name?



I have a chart I built in Excel using the Chart Wizard. It's a very simple bar chart, but I've noticed that the chart is a "living" chart. What I mean is, if the source data changes, so does the chart; it dynamicly changes with the source data.

That's a nice feature, but unfortunately it doesn't allow me to view the history of my data. Once the source data changes, so does my chart, and I lose that historical view of the chart.

What I want to do is take a copy of the chart and save it in a new Excel document that I want to keep as a historical reference to the data.

In theory, I'd be able to go to my new document and be able to page through certain dates, (each worksheet would be it's own date), to see what the chart looked like on that date.

The problem I'm now running into is that if I make a copy of the chart, it continues to be a "living" chart, even in a different Excel document. So, if my source data changes in my original document, it also changes the copied chart I was trying to keep in my new historical document.

My Question: Is there a way to make a copy of a chart, paste it, and save it as a static picture? That way, if/when the source data is changed and updated, my static picture is not changed along with it.

Do I need to invest in a screen-capture program like Snag-It to achieve my goal?

Thank you to anyone who may have an answer for me.

Please, please can anybody help with this problem. I had a command button successfully copying and a pasteing some info then deleting rows that match a given criteria. I decided to add a couple more actions, but from where the new code starts - Columns("H:H").Select - it flags up an error. Any ideas?? Thanks for reading.


Private Sub CommandButton1_Click()

Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Selection.Delete Shift:=xlToLeft
ActiveCell.FormulaR1C1 = "Checked"
ActiveCell.FormulaR1C1 = "?"
Selection.Font.Bold = True
With Selection
.HorizontalAlignment = clCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.MergeCells = False
End With
Dim r As Long
Application.ScreenUpdating = False
With Worksheets("Warehouse")
For r = .UsedRange.Rows.Count To 1 Step -1
If .Cells(r, "H").Value = "0" Then .Rows(r).Delete
End With
Application.ScreenUpdating = True

End Sub

Hello friends,
I have a problem. My macro is creating folders and is copying files in each folder. It is going all good. But when i want to manually delete one of the macro created folder, it dosent delete it but delete all files in that particular folder. It gives the option that "This is not located in C:PTA Microwave Documents. Verify the item's location and then try again." I dont know what is the problem in that particular folder because all the other folders are doing well except this. Moreover, the problem folder contain all fake files, means to say, the files in that folder are visible but when i try to open those files in that problem folder, the file dosent open and gives an error message.

What could be the problem in that particular folder ?? Is there any space error in the file/folder name or something else ??

Plzzzzzzz suggest something friends.. Any kind of help is warmly welcomed.



I have a macro that copies cells from an excel sheet to my presentation and moves the picture then to the desired place by moving it a bit left and a bit up. Unfortunately, the amount of cells copied/pasted changes. What happens now if the number of rows increases is, that the table still gets moved the same amount to the left and top. The result is, the bottom of the picture pasted in the presentation is always the same, but - because there are now more rows - the top of the picture is higher.

what I would like to have is rather that the top of the picture stays the same and, if the number of rows increases, the bottom is further down.

is there a way to do that, for example by determining where exactly the top left corner of the pasted picture will be, no matter how big the picture is?

Thanks for your help.


I have a template that has many user inserted pictures, I need to delete all the pictures when my macro runs except for one called "Picture121". This code will delete all but I cant figure out how to save "Picture121" from being removed. Can anyone help?

For Each F In ActiveWorkbook.Sheets 
    For Each S In F.Shapes 
    Next S 
Next F 

If you like these VB formatting tags please consider sponsoring the author in support of injured Royal Marines

I recently joined a new team at work who uses a spreadsheet to track savings. It is shared between multiple users. The problem is that for some reason, at some point, someone decided to copy the formatting all the way down to row 65536 and row IV. If you try to manually delete say 1000 blank rows it will run and result in the same situation. The SS is not currently locked as well. Since it is shared I cannot make a macro directly in it. I thought to get around this I would create one in another open workbook. I need it to delete all rows below 1313 and all columns right of BJ. Any help would be appreciated as I am currently trying to teach myself VBA from a book but it is a slow process for sure.



I have a created style in my sytle list and I cannot delete it as the delete button is faded grey.

Any ideas how I can get rid of it?

Many thanks

** Please do not add replies here. Use the original message **
I recently supplied code in answer to the requirement above. In June I wrote a macro to extract module names & subroutines to a worksheet, so it seems a good idea to link the two and enable deletion of a subroutine from a selection in the worksheet.

'- 1. List all subroutines in a workbook using "SHOW_ALL_MODULES" code found here :-
'- 2. Select a subroutine name - eg. 'MySubRoutine ()' - in the worksheet 'WB Contents'
'-    (the worksheet must be in the workbook containing the sub)
'- 3. Run macro "DeleteSelectedSubroutine"
'- Check Tools/References/"Microsoft Visual Basic for Applications Extensibility"
'- Brian Baulsom August 2007

Sub DeleteSelectedSubroutine()
    Dim MySub As String
    Dim MyModuleName As String
    '- get selection
    MySub = ActiveCell.Value
    MyModuleName = ActiveCell.Offset(0, -1).Value
    '- check valid selection
    If Right(MySub, 2)  "()" Or ActiveSheet.Name  "WB Contents" Then
        MsgBox ("You have not selected a valid subroutine in 'WB Contents' sheet" & vbCr _
            & "Subroutine : " & MySub & vbCr & "Module       : " & ModuleName)
            Exit Sub
    End If
    '- delete subroutine
    DeleteSubroutine MyModuleName, MySub
End Sub
'========= END OF MAIN ROUTINE ===================================================

Private Sub DeleteSubroutine(ModuleName, SubName)
    Dim MyModule As Object
    Dim MyLineNumber As Integer
    Dim MyLine As String
    Dim StartLine As Integer
    Dim EndLine As Integer
    Dim MySubLines As Integer
    Set MyModule = ActiveWorkbook.VBProject.vbComponents(ModuleName).codemodule
    MyLineNumber = 1
    With MyModule
        '- Find subroutine
        For MyLineNumber = 1 To .countoflines
            MyLine = .Lines(MyLineNumber, 1)
            If InStr(1, MyLine, SubName, vbTextCompare) > 0 Then
                StartLine = MyLineNumber
                Exit For
            End If
        '- check subroutine found
        If MyLineNumber >= .countoflines Then
            MsgBox ("Cannot find Sub " & SubName & "()" & vbCr _
                  & "in module '" & ModuleName & "'")
            Exit Sub
        End If
        '- Find End Sub
        While InStr(1, MyLine, "End Sub", vbTextCompare) = 0
            MyLineNumber = MyLineNumber + 1
            MyLine = .Lines(MyLineNumber, 1)
        EndLine = MyLineNumber + 1
        '- delete lines
        MySubLines = EndLine - StartLine
        .DeleteLines StartLine, MySubLines
    End With
    MsgBox ("Deleted Sub " & SubName & " ( )" & vbCr _
          & "from module '" & ModuleName & "'" & vbCr & "= " & MySubLines & " lines." _
          & vbCr & "Save the workbook to make change permanent.")
End Sub
'----------- end of sub routine --------------------------------------------------------

I am currently not well versed in Macro's for Excel.

One thing I'd like to know how to do is delete a Macro that I essentially
cannot find.

Here's what I did:

On an excel sheet I've been working with, went to:
>> Tools >> Macro >> Visual Basic Editor.

From there I went to Include >> Module [following the steps in Help]. But,
I then cancelled out of it by clicking on the close button [the X in top
right], and then closed the SpreadSheet [and saved when it asked].

But now when I start up it asks me if I want to enable Macros. When I do
enable them, and look through the Macros [Tools >> Macro >> Macros], I do not
see any Macros that I can delete.

So how can I delete a Macro / get that warning message to stop appearing?

I'm not concerned about the spreadsheet, I did this because I'm trying to
learn how to keep this warning from happening, but as it turns out I can't
figure it out.
Any help would be very much appreciated!


I'm trying to get delete a macro, but I when I hit the delete button it gives
me this error:

Cannot edit a macro on a hidden worksheet. Unhide the workbook using the
Unhide Command.

I've never heard of any "Unhide" command ... only hiding/unhiding rows and

An input worksheet referes to a vlookup list on another worksheet. One input
cell has a drop list that shows the vlookup list for selection purposes. I
have deleted the vlookup list but cannot delete the drop button.

No luck finding an answer? You could always try Google.