Converting Index Match to VBA Code

Geni O

New Member
Joined
Feb 5, 2019
Messages
2
I have the following formula in several cells in column C from row 8 to row 61:

=IFERROR(INDEX(Comments!$K$2:$K$76,MATCH(C22,Comments!$B$2:$B$76,0)),"COMMENT REQUIRED")

Since it is an index match, only values are copied. I would like to implement VBA code that will preserve this index match, but also keep the source formatting of what is being copied.
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
What formatting is it you want preserved?
 
Upvote 0
I would like to preserve the color and bold styling. Or ideally, the code wouldn't need to preserve the style, but will simply apply the style based on the index matched value. For example, if the value that is index matched from another sheet is equal to "Hello" I would like it to be bold and red. Otherwise it would just be normal.
 
Upvote 0

Forum statistics

Threads
1,223,230
Messages
6,170,883
Members
452,364
Latest member
springate

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