简体   繁体   中英

Interior.PatternTintAndShade Property

I am working on excel sheets with large amount of cell pattern based data. I am trying to read the values of these cell patterns and store that info in another sheet. But I am unable to do so as there is no function available to do this in Excel. Please help.

As per your title, it appears that you want VBA. Now, it is not clear if you want to copy Interior.Pattern , Interior.PatternTintAndShade , or perhaps something else.

The code you need is something like

Dim wssrc as Worksheet, wstrg as Worksheet
Dim rngsrc as Range, clsrc as Range, cltrg as Range
Set rngsrc = <what you want>
For Each clsrc in rngsrc
    Set cltrg = wstrg.Range(clsrc.Address)
    cltrg.Interior.PatternTintAndShade = clsrc.Interior.PatternTintAndShade
Next clsrc

(PS: I do not currently have a system with Excel, so this code may need little adjustments).

Other option that perhaps works for you is: first copy, and then use Range.PasteSpecial Method , with the first argument xlPasteFormats . This is the VBA method for Edit -> Paste Special (see comment by Jeeped).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM