copy area on spreadhseet as picutre

G

Galen

Sub test8()

Sheets("summary").Select
Range("b2:e142").Select
Selection.CopyPicture _
Appearance:=xlScreen, Size:=xlScreen, Format:=xlPicture
Sheets("EXPORTsmry").Select
Range("b2").Select
ActiveSheet.Paste


End Sub

this is the code i have, it is something that i found on here, and adapted
for some charts... it works for the charts in this format (below):

Sub test2()

Sheets("duration chart").Select
Sheets("duration Chart").ChartObjects("Chart 1").Select
ActiveChart.CopyPicture _
Appearance:=xlScreen, Size:=xlScreen, Format:=xlPicture
Sheets("EXPORT").Select
Range("b49").Select
ActiveSheet.Paste


End Sub

but when i tried to adapt it to copy a specific range (code at top) i get
an error... any help would be greatly appreciated
 
J

Jacob Skaria

What is the error? Are you sure the chart name is "Chart 1"..Try running this
in Step Into mode (F8)

If this post helps click Yes
 
J

Jacob Skaria

Oops..I misread..To copy a range the below should do

Sub Macro()
Sheets("summary").Range("b2:e142").Copy _
Sheets("EXPORTsmry").Range("b2")
End Sub

If this post helps click Yes
 
G

Galen

the reason i was trying to copy and paste as a picture is that data in the
range is subject to change, and i have a macro that goes through the original
page and hides the blank rows, and i want to maintain that formattting when i
copy and paste the range... is there a way to do that?
 
J

Jacob Skaria

The below method copy the formats too.If you mean copy only the formats...

Sheets("summary").Range("b2:e142").Copy
Sheets("EXPORTsmry").Range("b2").PasteSpecial Paste:=xlPasteFormats, _
Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False


If this post helps click Yes
 
G

Galen

thanks for your help
--
Thanks,

Galen


Jacob Skaria said:
The below method copy the formats too.If you mean copy only the formats...

Sheets("summary").Range("b2:e142").Copy
Sheets("EXPORTsmry").Range("b2").PasteSpecial Paste:=xlPasteFormats, _
Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False


If this post helps click Yes
 

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

Top