OzGrid

How to copy specific range and paste as pic to another sheet

< Back to Search results

 Category: [Excel]  Demo Available 

How to copy specific range and paste as pic to another sheet

 

Requirement:

 

The user has some sheets and produce some reports in each page.

 

The user wants a code to use for each page reports and paste them as picture in the last sheets.


Is there anyway using vba code that copy specific range " C30:J33" and turn them into image in another sheet "A1:H4" 

 

https://www.ozgrid.com/forum/forum/help-forums/excel-vba-macros/1203670-copy-specific-range-and-paste-as-pic-to-another-sheet

 

Solution:

 

Try this:

Code:
Option Explicit

Sub cpyPstPic()
Dim s1 As Worksheet, s2 As Worksheet
Set s1 = Sheets("Sheet1")
Set s2 = Sheets("Sheet2")
    s1.Range("C30:J33").CopyPicture Appearance:=xlScreen, Format:=xlPicture
    s2.Range("A1").PasteSpecial
End Sub

 

Obtained from the OzGrid Help Forum.

Solution provided by AlanSidman.

 

See also: Index to Excel VBA Code and Index to Excel Freebies and Lesson 1 - Excel Fundamentals and Index to how to… providing a range of solutions and Index to new resources and reference sheets

 

See also:

How to use Excel VBA to delete rows in a column based on a range of cells in another column
How to use IF/This (combo box value) Then That (Range Value) [Wildcards]
How to copy non-blank rows in a range and paste to other sheets
How to create VBA code to count specific texts from different ranges

 

Click here to visit our Free 24/7 Excel/VBA Help Forum where there are thousands of posts you can get information from, or you can join the Forum and post your own questions.


Gallery



stars (0 Reviews)