• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Simple copy macro not working

Busymanjohn

Member
Hi, I have a simple copy / paste macro recorded ( as below ), but I keep getting a runtime 1004 error and when I look for an explanation into the error I see that this error is common with password protected files .... i've removed the password and i still get the error ,, i'm not very good with vba so any suggestions would be appreciated.

Sub Copyone()
'
' Copyone Macro
'

'
ActiveWindow.LargeScroll Down:=1
Range("B2:AF34").Select
Selection.Copy
Application.CutCopyMode = False
Selection.CopyPicture Appearance:=xlPrinter, Format:=xlPicture
Sheets("Ball Scores").Select
Range("B3").Select
ActiveSheet.Paste
ActiveSheet.Shapes.Range(Array("Picture 3")).Select
Range("A2").Select
End Sub
 
You may be getting an error as Picture 3 may already exist
Try changing it to Picture 4 and rerun
 
Try replacing all the above code with:
Code:
  Range("B2:AF34").CopyPicture Appearance:=xlPrinter, Format:=xlPicture
  Sheets("Ball Scores").Select
  Range("B3").Select
  ActiveSheet.Paste
 
Try replacing all the above code with:
Code:
  Range("B2:AF34").CopyPicture Appearance:=xlPrinter, Format:=xlPicture
  Sheets("Ball Scores").Select
  Range("B3").Select
  ActiveSheet.Paste

Hi Hui, still not working .... doesn't seem to like the Sheets("Ball Scores").Select line
 
Can you post the file as it works on a dummy setup here

Hi Hui, sorry I haven't replied sooner, managed to get your solution to work, saved and closed workbook, re-opened and it worked, no idea why, but at least it works now, Thanks for your help :)
 
Back
Top