Skip to content

Instantly share code, notes, and snippets.

@honda0510
honda0510 / gist:801365
Created January 29, 2011 01:04
【Excel VBA】シート検索
Option Explicit
Sub シート検索()
Const TITLE As String = "シート検索"
Const DEFAULT_EXPLANATION As String = "表示したいシート名を入力してください。"
Dim conversion As VbStrConv
Dim explanation As String
Dim find As String
Dim sheet_name As String
@honda0510
honda0510 / gist:805595
Created February 1, 2011 08:42
【Access VBA, moug】アクセスVBAでフォルダを開く http://www.moug.net/faq/viewtopic.php?t=56729
Option Compare Database
Option Explicit
Sub test()
Dim path, action
path = TestGetFileName
action = "open" 'Print
fileAction path, action
End Sub
@honda0510
honda0510 / gist:805649
Last active September 24, 2015 20:37
【VBA】文字エンコーディング変換関数
' 参照設定
' Microsoft ActiveX Data Objects 2.x Library
Function ConvCharSet(from_bin, from_charset, to_charset)
Dim from_stm As ADODB.Stream
Dim to_stm As ADODB.Stream
' バイナリ型のStreamオブジェクトを作成
Set from_stm = New ADODB.Stream
from_stm.Open
@honda0510
honda0510 / hta+jQuery.hta
Created February 2, 2011 05:44
複数のコントロールに同じイベントを設定する、hta + jQuery のサンプル
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>hta + jQuery sample</title>
</head>
<body>
<button>ELMO</button><br />
@honda0510
honda0510 / jQuery UI Dialog.hta
Created February 3, 2011 09:30
jQuery UI Dialog sample
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>jQuery UI Dialog Sample</title>
<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/themes/redmond/jquery-ui.css" />
<style>
#contents { display: none; }
</style>
@honda0510
honda0510 / gist:817682
Created February 9, 2011 01:10
【VBA】XML インデント
Function indent(ByVal xml As String) As String
Dim writer As MSXML2.MXXMLWriter
Dim reader As MSXML2.SAXXMLReader
Dim dom As MSXML2.DOMDocument
Dim n As MSXML2.IXMLDOMNode
Set writer = New MSXML2.MXXMLWriter
' xml宣言を書き込まない
writer.omitXMLDeclaration = True
' インデントする
@honda0510
honda0510 / gist:817689
Created February 9, 2011 01:18
【VBA】\u3042→あ とするサンプル
Option Explicit
Sub test()
Dim bin(1) As Byte
bin(0) = &H30
bin(1) = &H42
Debug.Print bin2text(bin, "UTF-16BE")
End Sub
@honda0510
honda0510 / MultipleWorkspaces.vbee
Created February 24, 2011 05:36
【EmEditor,マクロ】「名前を付けて複数のワークスペースを管理するマクロ」 My Macrosフォルダ版http://jp.emeditor.com/modules/newbb/viewtopic.php?topic_id=1550&forum=19
' FileSytemObjectを生成
Set fso = CreateObject("Scripting.FileSystemObject")
' ログインユーザー名を取得
Set wshNetwork = CreateObject("WScript.Network")
userName = wshNetwork.UserName
' ワークスペースファイルがあるフォルダ
wsPath = "C:\Documents and Settings\" & userName & "\Local Settings\Application Data\Emurasoft\EmEditor\Workspace\"
' ワークスペースとして認識されるファイル名
wsNameDefault = "LastData.bin"
@honda0510
honda0510 / OpenFile.jsee
Created February 24, 2011 05:41
【EmEditor,マクロ】ソースに書かれたメソッド名やファイル名を選択してファイルを開く (PHPの静的メソッド, php, css, js, tplファイルに対応)
var fso = new ActiveXObject('Scripting.FileSystemObject');
var CUR_DIR = document.path;
var PARENT_DIR = fso.GetParentFolderName(CUR_DIR);
var FIND_OPTTION = eeFindAround + eeFindNext + eeFindReplaceCase + eeFindReplaceOnlyWord + eeFindSaveHistory;
// 選択中のテキスト
var selection = document.selection.Text;
// 選択中のテキストがファイル名だったら拡張子を小文字で取得
var extension = fso.GetExtensionName(selection).toLowerCase();
// 検索するフォルダのリスト
@honda0510
honda0510 / gist:843880
Created February 25, 2011 14:46
vanillaの開発環境を構築する手順書
■ 要件
Requirements - Vanilla Forums
http://vanillaforums.org/docs/installation-requirements
○ PHP version 5.2.0 or newer
○ PHP Config (php.ini): file_uploads = on
○ PHP Data Objects module installed (http://www.php.net/pdo)
○ PDO_MySQL module must be enabled (http://www.php.net/manual/en/ref.pdo-mysql.php)
○ GD version 2.0 or newer (optional, but required for profile pictures)