Hi. I am using Excel 2000.
I have made a macro which will save a range on a Sheet
to a seperate Sheet as a Bitmap file on that Sheet (see code below).
The BMP file format saves images larger than the JPG
(or JPEG) format. Do you know of any VBA code which
could save save a specified range as a seperate, external
JPG file ? By "seperate, external" I mean independent of
Excel and in the same directory as the Excel workbook from
which it derived the picture. (Or, if not a JPG, perhaps as a
GIF file ?)
Or, if a seperate, external JPG file could not be generated
from Excel, could a JPG copy of the range be placed onto a
different Sheet (such as the code I have below).
Also, could such a macro get the name for the intended
JPG file from a cell on the Sheet. For example, from cell A5.
If cell A5 read as "Budget2005", then the JPG would be
saved as Budget2005.jpg.
Thank for your help.
Ken
'-------------------------------------------------
Sub CopyRangeAsBMP()
'choose the Sheet from which you need your picture
Worksheets("SourceSheet").Activate
'specify your range
Range("M11:R73").Select
Selection.CopyPicture Appearance:=xlScreen, Format:=xlBitmap
Range("A1").Select
'Goto the proper Target Sheet and Paste This
Sheets("DestinationSheet").Select
'select cell where Picture will be placed
Range("A1").Select
'Paste the Picture to cell
ActiveSheet.Pictures.Paste.Select
'Position Cursor
Range("M5").Select
End Sub
I have made a macro which will save a range on a Sheet
to a seperate Sheet as a Bitmap file on that Sheet (see code below).
The BMP file format saves images larger than the JPG
(or JPEG) format. Do you know of any VBA code which
could save save a specified range as a seperate, external
JPG file ? By "seperate, external" I mean independent of
Excel and in the same directory as the Excel workbook from
which it derived the picture. (Or, if not a JPG, perhaps as a
GIF file ?)
Or, if a seperate, external JPG file could not be generated
from Excel, could a JPG copy of the range be placed onto a
different Sheet (such as the code I have below).
Also, could such a macro get the name for the intended
JPG file from a cell on the Sheet. For example, from cell A5.
If cell A5 read as "Budget2005", then the JPG would be
saved as Budget2005.jpg.
Thank for your help.
Ken
'-------------------------------------------------
Sub CopyRangeAsBMP()
'choose the Sheet from which you need your picture
Worksheets("SourceSheet").Activate
'specify your range
Range("M11:R73").Select
Selection.CopyPicture Appearance:=xlScreen, Format:=xlBitmap
Range("A1").Select
'Goto the proper Target Sheet and Paste This
Sheets("DestinationSheet").Select
'select cell where Picture will be placed
Range("A1").Select
'Paste the Picture to cell
ActiveSheet.Pictures.Paste.Select
'Position Cursor
Range("M5").Select
End Sub