VBA to show worksheet range of cells in a userform

cvrband

Board Regular
Joined
Jan 6, 2016
Messages
63
Office Version
  1. 365
Platform
  1. Windows
Greetings - my goal is to show a range of cells from a worksheet named "Data" in a userform so that this range can be visible on another worksheet named "Input" in the same workbook. I will need this userform to remain viewable while working in "Input" until the userform is closed by the user. I will set up a button to call this macro/code on the "Input" sheet. I'm also familiar with setting up userforms and inserting controls such as images, labels, text boxes, etc. but am at a loss on how to create this code.

The range of cells to be shown is from $A$50 to column 'G' and the last used row of column 'D' (the last row will fluctuate as dictated by column 'D'. Also, there will be no data below the last used cell in column 'D'). I'd like the userform to show this cell range like a picture (keep formatting) if possible. Is a userform the best way to do this? I'm open to suggestions if not. Can someone please assist me with writing this type of code?

Thank you in advance for working with me.
 

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.
I believe this could be very difficult if not impossible.
That is a large range of data to enter into a UserForm.
It maybe could be done with what is know as listview
But the formatting cannot be loaded in listview.
You said:
I'm open to suggestions if not

We may have another way of doing things but you have not explained why you want to see a range of cells in another sheet. Do you just want to see them or also modify them.
 
Upvote 0
Thanks for your reply and willingness to help M.A.I.T.

Below is a screenshot of what I would like to show with the range described in my initial post (data stripped). The range will typically be a max of 27 rows and most often much less (~10) including the header rows.
1574350688895.png

My initial thought was to select the range in VBA and copy it as a picture and then paste it into a userform as an image. Now seeing the range/data, do you still feel this would not be possible?

I did find this video showing how to show the range by creating a jpeg and saving it to a temporary location/file but wasn't sure that was the best way. It may give you some ideas.

I also investigated the 'camera tool' but wasn't able to specify a range of cells as I understand the area is selected with a pick tool (cursor selection).

How would a listview look? I don't necessarily need the green color or the column width exactly as shown but would like the columns and rows differentiated with lines. (note: columns G-I are merged starting in row 29.)

To answer your last question. I only want to see the data for reference, not manipulate it in the other worksheet.

Thanks again!
 
Upvote 0
This thread seems to have gone dormant. I am still looking for a solution to my original post and would like help with it if possible. Thank you.
 
Upvote 0
Not sure if you found a solution, but I was able to do this using this tutorial...

 
Upvote 0

Forum statistics

Threads
1,223,929
Messages
6,175,460
Members
452,644
Latest member
gjcase

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