Home > Excel VBA | GraphControl > UserFormからシートをスクロール(Scrolling spread sheet from userform)

UserFormからシートをスクロール(Scrolling spread sheet from userform)


UserForm からエクセルシートをスクロールさせるマクロです。

Scrolling Excel's spead sheet using spinbtton.

SpinUp & SpinDown event(別のイベントを使った例)

スピンボタンを使って、エクセルシートをスクロールさせるマクロを紹介します。しかし、このやり方ではスピンボタンをクリックした場合、最後にスピンボタンの値を0に初期化してますのでプロシージャが2度呼び出されます。あまり関心しないコードですが、ユーザーフォームの見栄えもいいし、繰り返し処理されないシンプルなものなので差し支えないと思って使いました。違った方法もあります。Excel 2007の場合は、スクロールの制限値が1,000,000になります。(下記コードを追加しました)

If SpinButton1.Value = 0 Then Exit Sub ''---2度目に呼び出された場合、余計な処理を省きます

the code below is to scroll spread sheet using spinbtton. In this case, this procedure is called twice in click event, so that I donot recommend this code unless using loops. Well, the only reason I use this code is just looks better and simple. Of course, there are different methods....code of a system is never same like the words of song. Also, if you are using Excel2007, the scrollin limit will be 1,000,000.

GraphControl で使用しているコードです。上のプロシージャでシートが選択されたときに、セルをアクティブにします。

the code below is used in GraphControl.

Comments:0

Comment Form

Home > Excel VBA | GraphControl > UserFormからシートをスクロール(Scrolling spread sheet from userform)

Return to page top