• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Display Picture in User forms after capturing picture in excel

nagovind

Member
Dears,

Is there is any way to capture range of cells and display the captured region as a picture in a window in user for such that after display it can be closed by the user.

Please advise.

Code:
Sub Macro4()

    Sheets("Sheet2").Select
    Range("C2:F14").Select
    Selection.CopyPicture Appearance:=xlScreen, Format:=xlBitmap
    Sheets("Sheet2").Select
    Range("A1").Select
    ActiveSheet.Paste '(Instead of this pasting into active sheet need to display in unser form as a window such that after display it can be closed by the user')

End Sub
 
PCosta
This is not working in the file that contains already other objects for other

Kindly advise
Code needs to identify the object that is crossing the selection

Pl do the needful

I'm getting Below error

upload_2016-11-18_19-42-39.png
 
Dear PCosta,
Thank you for your reply.
Sorry for uploading the password protected file.
Attached is the file
Kindly advise the solution
Regards
Govind
 

Attachments

  • thisfile.xlsm
    39.6 KB · Views: 1
@nagovind

Here you go
Notice there is a Chart in A1:A2 that must not be deleted

Let me know if there is anything I can help with
 

Attachments

  • thisfile.xlsm
    35.4 KB · Views: 5
Dear PCosta,

Thanks for your help.

It is ok if there is one sheet.

I have attached the file that contain more than one sheet.

Actual file has around 20 sheets. This operation has to be performed in all 20 sheets,

Kindly advise, how to go with.

Regards
Govind
 

Attachments

  • thisfile new 1.xlsm
    60.7 KB · Views: 3
@Pcosta,

Yes it is working good. Thanks for your help
Please help to transfer the code into my original file

I have exported the userform and code module into original file again it shows same error.

Kindly advise what needs to be transferred to the new file to make the code work.

Chart in A1:A2 to be copied to new workbook ? with same name to all 20 sheets. Please advise

Regards
Govind
 
Pcosta,

Its working in my original workbook after copying the chart in A1:A2
What is behind A1:A2

THANKS A LOT

Great help

Regards
Govind
@nagovind

There is nothing in A1:A2 besides that chart.
The way this works is by pasting whatever is on the clipboard to the chart and then using it to insert into the userform, which is why you need the chart in the sheet. There is nothing special about the chart's location... you can move it wherever you want inside the sheet
 
@Pcosta,

After fine tuning, i have some issues. Please refer to the uploaded file.
While calling the code from other sheet it is not doing the job,
kindly advise

The image to be displayed is in next sheet but the active sheet is different in such case the required cell content is not displayed in pop-up.

Please do the needful

Thanks
Regards
Govind
 

Attachments

  • thisfile new 2.xlsm
    91.2 KB · Views: 2
@Pcosta,

After fine tuning, i have some issues. Please refer to the uploaded file.
While calling the code from other sheet it is not doing the job,
kindly advise

The image to be displayed is in next sheet but the active sheet is different in such case the required cell content is not displayed in pop-up.

Please do the needful

Thanks
Regards
Govind
Hi

Sorry for the late response

Just remove
Code:
Application.ScreenUpdating = False
Application.ScreenUpdating = True

Since this depends on selection to display, you can't disable ScreenUpdating.
Please see attached... changed code from sheets to module (can't remember why I didn't do that in the first place :confused:)
 

Attachments

  • thisfile new 2.xlsm
    83.7 KB · Views: 11
@ PCosta

Thanks for your reply
sorry for bothering you

Actually the pop-up requirement is to HIDE the other sheet content and getting the display of the required portion of the selected sheet while clicking the icon....
Thanks once again for help...

Govind
 
@ PCosta

Thanks for your reply
sorry for bothering you

Actually the pop-up requirement is to HIDE the other sheet content and getting the display of the required portion of the selected sheet while clicking the icon....
Thanks once again for help...

Govind
Hi,

Here you go

Let me know if there is anything else I can help with
 

Attachments

  • thisfile new 2.xlsm
    82.9 KB · Views: 8
@Pcosta,

Really a great
Thanks for you help....
Could you please advise the changes ....

This is 100% perfect and it is working for me....

Thanks
Govind
 
@Pcosta,

Really a great
Thanks for you help....
Could you please advise the changes ....

This is 100% perfect and it is working for me....

Thanks
Govind
Hi,

You are welcome ;)

Nothing much changed... instead of "selection" I referred to the actual range of the sheet name found in the cell:
Code:
Sheets(Sheets("FRONT PAGE").Range("I4").Value).Range("G6:Y16")

Since form already knows what to show, the "ClickMe" button only shows form:
Code:
frmPasteChart.Show
 
Back
Top