How to get a range as a picture on a userform

MHD

New Member
Joined
Mar 16, 2021
Messages
49
Office Version
  1. 2019
Hi

I have a range that I need to show on a user form, but I DO NOT want to use a list box. I want the range on the user form to look exactly like the original range on the sheet.

Anyone know the VBA to do this?



The range: sheets ("Invoice_Labor").range("A1:F35")
user form name: UserForm1
Command Button name: CB_Apply

Thanks
 
The code works great
Thank you very much for the interaction

But I am still having a problem
The size of the image that the code has inserted does not correspond to the size of the image area in the user form.
Can we make the code automatically resize the image entered into the user's form?

Is there a solution for that, please
You can do all sorts of things with the imported image, but it requires experimentation on your part. The image control has several properties that control how the image is displayed. For example, the sample code I posted has this

VBA Code:
    UserForm1.Image1.AutoSize = True

If you set it to 'False' the image will display differently. There are also the PictureAlignment, PictureSizeMode, and PictureTiling properties that you can experiment with.
 
Upvote 0

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

Forum statistics

Threads
1,214,628
Messages
6,120,618
Members
448,973
Latest member
ChristineC

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top