合計から逆算するExcelマクロを作ってみた

2013年07月17日

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/popleaf/www/popleaf-jp/wordpress/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/popleaf/www/popleaf-jp/wordpress/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/popleaf/www/popleaf-jp/wordpress/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/popleaf/www/popleaf-jp/wordpress/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/popleaf/www/popleaf-jp/wordpress/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/popleaf/www/popleaf-jp/wordpress/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/popleaf/www/popleaf-jp/wordpress/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/popleaf/www/popleaf-jp/wordpress/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/popleaf/www/popleaf-jp/wordpress/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/popleaf/www/popleaf-jp/wordpress/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/popleaf/www/popleaf-jp/wordpress/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/popleaf/www/popleaf-jp/wordpress/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/popleaf/www/popleaf-jp/wordpress/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/popleaf/www/popleaf-jp/wordpress/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/popleaf/www/popleaf-jp/wordpress/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/popleaf/www/popleaf-jp/wordpress/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/popleaf/www/popleaf-jp/wordpress/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/popleaf/www/popleaf-jp/wordpress/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/popleaf/www/popleaf-jp/wordpress/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/popleaf/www/popleaf-jp/wordpress/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/popleaf/www/popleaf-jp/wordpress/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/popleaf/www/popleaf-jp/wordpress/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/popleaf/www/popleaf-jp/wordpress/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/popleaf/www/popleaf-jp/wordpress/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/popleaf/www/popleaf-jp/wordpress/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/popleaf/www/popleaf-jp/wordpress/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/popleaf/www/popleaf-jp/wordpress/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/popleaf/www/popleaf-jp/wordpress/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/popleaf/www/popleaf-jp/wordpress/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/popleaf/www/popleaf-jp/wordpress/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/popleaf/www/popleaf-jp/wordpress/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/popleaf/www/popleaf-jp/wordpress/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/popleaf/www/popleaf-jp/wordpress/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/popleaf/www/popleaf-jp/wordpress/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/popleaf/www/popleaf-jp/wordpress/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/popleaf/www/popleaf-jp/wordpress/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/popleaf/www/popleaf-jp/wordpress/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/popleaf/www/popleaf-jp/wordpress/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/popleaf/www/popleaf-jp/wordpress/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/popleaf/www/popleaf-jp/wordpress/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/popleaf/www/popleaf-jp/wordpress/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/popleaf/www/popleaf-jp/wordpress/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/popleaf/www/popleaf-jp/wordpress/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/popleaf/www/popleaf-jp/wordpress/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/popleaf/www/popleaf-jp/wordpress/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/popleaf/www/popleaf-jp/wordpress/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/popleaf/www/popleaf-jp/wordpress/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/popleaf/www/popleaf-jp/wordpress/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/popleaf/www/popleaf-jp/wordpress/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/popleaf/www/popleaf-jp/wordpress/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/popleaf/www/popleaf-jp/wordpress/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match_all(): Compilation failed: invalid range in character class at offset 4 in /home/popleaf/www/popleaf-jp/wordpress/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 700

Warning: Invalid argument supplied for foreach() in /home/popleaf/www/popleaf-jp/wordpress/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 707

Warning: preg_match_all(): Compilation failed: invalid range in character class at offset 4 in /home/popleaf/www/popleaf-jp/wordpress/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 700

Warning: Invalid argument supplied for foreach() in /home/popleaf/www/popleaf-jp/wordpress/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 707

どーも。Hotateです。

今日はエクセルでちょっと便利なマクロを組んでみました。
前に数値の間違い探しというか、誤差の合計が分かっていて怪しそうな部分(数値)もわかっているけど、どの数値と数値を足したらこの合計になるのか簡単にわかる方法はありませんか?
そんなことを聞かれた事があります。

今更ながら、個数(足し算する数値)限定で簡単なVBAマクロを組んでみました。

 

ただし、目標値になる数値の組み合わせが複数ある場合は組み合わせの個数が少ない方、且つ最後に発見した組み合わせを表示しちゃいます(バグですが、直しません。)ので注意してください。

 

怪しい数値を入力する

fig1

最初の画面です

fig2

赤い枠の部分(24個の数値が入ります)に怪しい数値を入力します。

怪しい数値の合計の目標値を入力する

fig3

誤差など、怪しい数値の合計(何かと何かの)を入力して、「チェック」ボタンをクリックします。

足すと目標値になる数値に目印ON!

fig4

こんな風に合計すると目標値になる数値のところが黄色くなります。

fig5

数値の個数は4個まで対応しています。

 

VBAマクロの中身は自由にカスタマイズして頂いてもOKです。
ぜひ使ってみて下さい。

ダウンロードはこちらからどうぞ。

※もちろん無料です。ウイルスは入ってません。(入れられません)

「こんなこと出来たらなー」というちょっとしたリクエストなんかもお待ちしておりまーす。
ではー。

コメント