Skip to content

Instantly share code, notes, and snippets.

@ooltcloud
Last active August 29, 2015 14:12
Show Gist options
  • Save ooltcloud/187edd23f78c77d3e693 to your computer and use it in GitHub Desktop.
Save ooltcloud/187edd23f78c77d3e693 to your computer and use it in GitHub Desktop.
条件付き書式で設定したセル色を固定化して貼り付ける (Excel 2013)
Sub PasteDisplayInterior()
Set wsh = CreateObject("WScript.Shell")
cmd = "Powershell -sta -command " _
& """" _
& " Add-Type -an System.Windows.Forms; " _
& " $a = [System.Windows.Forms.Clipboard]::GetData('HTML Format'); " _
& " [System.Windows.Forms.Clipboard]::Clear(); " _
& " [System.Windows.Forms.Clipboard]::SetData('HTML Format', $a); " _
& """"
wsh.Run cmd, 0, True
ActiveSheet.Paste
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment