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

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.

Forum statistics

Threads
1,214,979
Messages
6,122,550
Members
449,088
Latest member
davidcom

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