VBA Copy visible cells as a picture

willow1985

Active Member
Joined
Jul 24, 2019
Messages
458
Office Version
2019
Platform
Windows
Hello,

I have a macro that filters column Q removing blank cells. Once it is filtered to show only the cells with data I am looking for a code that will copy all visible cells from Q2 down and copy them as a picture.

Any idea what code I could use?

Thank you for all your help!

Carla
 

Some videos you may like

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

willow1985

Active Member
Joined
Jul 24, 2019
Messages
458
Office Version
2019
Platform
Windows
Nevermind, I figured it out. Once my Data is filtered to remove blanks, I use the following code:

Code:
LastRowColumnQ = Cells(Rows.Count, 1).End(xlUp).Row
    Range("Q2:Q" & LastRowColumnQ).Select
    Selection.CopyPicture Appearance:=xlScreen, Format:=xlPicture
Hope this post helps someone out there :)
 

Eric W

MrExcel MVP
Joined
Aug 18, 2015
Messages
9,570
Depending on your particular situation, you might be able to do this without any code at all. Before filtering, select and copy Q2:Q100 (or your maximum range). Right click the cell where you want the picture. Where it says "Paste Special" hover the mouse over the arrow on the right, then choose the bottom right icon (Linked Picture). It will automatically adapt as you filter your range. If you want a picture that doesn't change, select your range after it's filtered, copy it, then Paste Special with the Picture option (bottom row, second from right). If you still want VBA code, we can automate that process.
 

Watch MrExcel Video

Forum statistics

Threads
1,095,794
Messages
5,446,525
Members
405,406
Latest member
tuxy

This Week's Hot Topics

Top