Forcing Match Destination Formatting

Lilii

New Member
Joined
Jan 24, 2023
Messages
6
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
Hi all,

I'm very new to Excel VBA so please bear with me.

I'm currently trying to force users to paste only so that it matches the destination formatting.

I've seen the following posts but it doesn't work for my situation:
The cells where you can copy are the only Unlocked cells of my spreadsheet, knowing that the sheet would ideally be protected once my work is done.

I've also tried to see how excel is actually coding the paste matching destination formatting using the record macro button, and it gave me this:
VBA Code:
    ActiveSheet.PasteSpecial Format:="HTML", Link:=False, DisplayAsIcon:= _
        False, NoHTMLFormatting:=True

Can someone please help me find a work around, I've been at it for hours and still can't get it to work.

Thanks a lot for your help!

Lili
 
Hi James,

I'm so sorry, the solution (that I misread when I read your first message) you've offered works like a treat, thanks a lot!

Mumps, sorry if that wasn't clear but D11 was already unlocked.

Thanks a lot for your help, my issue is officially solved!
 
Upvote 0

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK

Forum statistics

Threads
1,223,727
Messages
6,174,148
Members
452,547
Latest member
Schilling

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