image bank

jasman

Board Regular
Joined
Oct 30, 2010
Messages
141
Hi. I have a workbook where i have created a programme which contains a dataset of images in different colours and a macro which transfers the images onto another worksheet depending on the colours chosen by the user.
I have now protected the worksheets ( only the cells which contains the images), but when I hit the macro button to create image it doesnt transfer the images anymore?

any ideas?

thanks
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Private Sub CommandButton1_Click()
Application.ScreenUpdating = False


If Sheet11.Cells(3, 2).Value = "X" Then
ActiveSheet.Shapes("Picture 1").Select
Selection.Copy
Sheets("PBOM").Select
ActiveSheet.Range("f9").Select
ActiveSheet.Paste
Sheets("Suspension").Select


ElseIf Sheet11.Cells(3, 2).Value = "U" Then

ActiveSheet.Shapes("Picture 6").Select
Selection.Copy
Sheets("PBOM").Select
ActiveSheet.Range("f9").Select
ActiveSheet.Paste
Sheets("Suspension").Select


ElseIf Sheet11.Cells(3, 2).Value = "P" Then

ActiveSheet.Shapes("Picture 3").Select
Selection.Copy
Sheets("PBOM").Select
ActiveSheet.Range("f9").Select
ActiveSheet.Paste
Sheets("Suspension").Select


ElseIf Sheet11.Cells(3, 2).Value = "M" Then

ActiveSheet.Shapes("Picture 8").Select
Selection.Copy
Sheets("PBOM").Select
ActiveSheet.Range("f9").Select
ActiveSheet.Paste
Sheets("Suspension").Select

End If

End Sub
 
Upvote 0
Well, one easy way is to unprotect your sheet in the code, do the copying and then reprotect the sheet afterwards, if you want to leave your sheet protected after the macro runs.
 
Upvote 0
i need it to be protected all the time- well as long as it doesnt let the user delete or alter the images in the cells is the main thing. However the problem is the macro I have copy and pastes the images onto another sheet which doesnt work if protected..... thanks
 
Upvote 0
I suggested that you could unprotect ( in the macro ), do the processing ( in the macro ), and reprotect ( in the macro ) .... how would that let the user delete or alter images? It wouldn't as far as I can see.

Can you explain why my suggestion is not sufficient?
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,278
Members
452,902
Latest member
Knuddeluff

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