0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

エクセルをサクラに貼り付けて、インサートデータの形にするサクラマクロ

Last updated at Posted at 2022-02-15

サクラへの貼り付けは手動だよ

マクロ本文

UTF-8 BOM付で保存してね。

createInsetData.mac
//キーボードマクロのファイル
ReplaceAll('\\t', '\', \'', 38);	// すべて置換
ReDraw(0);	// 再描画
ReplaceAll('^', '\\t(\'', 38);	// すべて置換
ReDraw(0);	// 再描画
ReplaceAll('$', '\'), ', 38);	// すべて置換
ReDraw(0);	// 再描画

実行前後

これが

データ1	データ2	データ3
データ1	データ2	データ3
データ1	データ2	データ3
データ1	データ2	データ3
データ1	データ2	データ3
データ1	データ2	データ3
データ1	データ2	データ3
データ1	データ2	データ3
データ1	データ2	データ3

こうなる

	('データ1', 'データ2', 'データ3'), 
	('データ1', 'データ2', 'データ3'), 
	('データ1', 'データ2', 'データ3'), 
	('データ1', 'データ2', 'データ3'), 
	('データ1', 'データ2', 'データ3'), 
	('データ1', 'データ2', 'データ3'), 
	('データ1', 'データ2', 'データ3'), 
	('データ1', 'データ2', 'データ3'), 
	('データ1', 'データ2', 'データ3'), 

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?