How to export a range to a picture ?

  • Thread starter Thread starter Ayato
  • Start date Start date
A

Ayato

Hello,

I am trying to create a macro that could export (save) a range (fo
example {A1:T20} to a picture (bitmap).

A little bit like a printscreen or a screen capture...

Anybody have any idea if it is possible ?

Please advise,

regards,
Ayat
 
Hi Ayato,

I think it was Jim Wilcox who first suggested copying the range to a chart
and then using the chart.export method to save as a gif.

Something like this will do it;

Sub CopyRngToGif()
Dim MyRange As Range

Application.DisplayAlerts = False

Set MyRange = Worksheets(1).Range("A1:C6")

MyRange.CopyPicture

With Charts.Add
.Paste
.ChartArea.Clear
.Export "C:\temp\MyRange.gif"
.Delete
End With

Application.DisplayAlerts = True

End Sub

Ed Ferrero
http://edferrero.m6.net
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top