Stu said:
How can I automate the 'Camera' function in Excel VBA? I
tried using the record macro option but this doesn't work.
I just want to copy a snapshot of a pivot table from one
sheet into another using the 'camera' option.
Hi Stu,
Here's the general idea of how it works. You'll probably need to play
around with the specifics to fit your situation. The numbers specified after
the Pictures.Add method refer to the Left, Top, Width, and Height,
respectively, of the picture being added. The Left and Top are the only ones
you care about. The Width and Height numbers are just placeholders. The
actual picture will expand to the size of the range you copy in the first
line.
Sub AddPicture()
Sheet1.UsedRange.Copy
Sheet2.Pictures.Add 10, 10, 10, 10
Application.CutCopyMode = False
End Sub
--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/
* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *