Excelのこととか色々

Excel のこととか楽天とか いろいろ書いてみます・・・

【Excel/VBA 03】Adjust Row Height and Column Width by One Click

Excel/English

※This is a re-write of the following article in English. 
 Also, this article would be simpler than the Japanese one.

www.tuna-kichi.com

 

 I will introduce a simple macro of adjusting rows and columns.

 It will be more convenient if you add it to the ribbon.

 

 

 _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

 

Automatically adjust row height and column width

Macro

Adjust row height 

****************************************
Sub AutoAdjustRowHeight

  Rows(Selection.Row).Autofit

End

****************************************

 

 Adjust column width

****************************************
Sub AutoAdjustColumnWidth

  Columns(Selection.Column).Autofit

End

****************************************

 

It should be easy.

Only one sentence.

 

 

I will explain it simply.

Rows・・・Designate rows

(Selection.Row)・・・Designating row which currently selected.

Autofit・・・Automatically adjust

 

Designate row number in the parentheses.

basically, a row number will be written there such as 1, 3, or 254.

 

Also, you can use "Selection.Row", as I wrote above.

That means you designate the row number which currently selected cell.

(likewise columns)

 

 

 

Add the macro on the Ribbon

1. Right-click on the Ribbon anywhere blank.

2. Click "Customize the Ribbon"

3. Click "Macro" from "Choose Command from"

4. Select the macro you just created

5. Click the place where you want to display it no the right pane

6. Click the "Add" button

7. Rename it

 

 

It should be something like this.

f:id:tuna-kichi:20200201134504p:plain

 

 

Please check a little more detail from the following article.

www.tuna-kichi.com

 

The size of the cells which you selected is automatically adjusted when you click the macro on the Ribbon.

 

 

Reduces mouse slippage and failure.

 

f:id:tuna-kichi:20200201140639p:plain

 

 This macro makes +10pt from the current size.

+10pt row height

*****************************************************************************************

Sub RowHeightPlus10pt()

  Rows(Selection.Row).RowHeight = Rows(Selection.Row).RowHeight + 10

End Sub

*****************************************************************************************

 

Meaning...

The row height of the selected cell = the row height of the selected cell +10pt

 

The difference is only "+10" between the left and right.

 

I manually resize the column width on my work, though the macro of adjusting column width is the same as row's.  

Just replace the row with the column.

 

*****************************************************************************************

Sub ColumnWidthPlus10pt()

  Columns(Selection.Column).ColumnWidth = Columns(Selection.Column).ColumnWidth + 10

End Sub

*****************************************************************************************

 

 

Combine them

 

*******************************************************************************************

Sub AutofitAndRowHeightPlus10()

  Rows(Selection.Row).AutoFit 

  Rows(Selection.Row).RowHeight = Rows(Selection.Row).RowHeight + 10

End Sub

******************************************************************************************* 

 

Just combined them.

The row height will be +10pt after AutoFit is done.

 

_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

 

【英語日記BOYさんがTVに出てた・・・雑記】

f:id:tuna-kichi:20200211075717p:plain

 

夕食を食べているときに、「英語日記BOY」さんの

英語の勉強法について放送されていました。

 

日記をつけること。

自分の言いたいこと、話したいことを調べて英語にする。

そして、その文章を声に出して練習する。

 

すごく共感しました。

インプットより、アウトプットの方に重点を置いているんですよね。

 

私も、実際に使った方が習得しやすいことを乏しい経験から感じています。

なので、私に、英語の勉強法などについて聞いてくる人がいたら、

「Practical training がいいよ」

と回答しています。

(最近いないけど・・・)

 

 

英語日記BOYさんも

「何回も声に出す、発音する、100回くらいやれば覚える」

というようなことをおっしゃっていました。

(うろ覚えなので、間違っていたらごめんなさい)

 

そして、「楽しい」 ともおっしゃっていました。

 

・・・

そこが、一番重要だと思います。

あくまでも個人的な意見ですが、

続けることが一番重要だと思います。

 

続けることができないから、習得できないのです。

なぜ続かないかというと、

「楽しくないから」

ではありませんか?

 

受験英語だろうが実用的でなかろうが、続けている人は

それなりに高い知識や、技術を習得しているはずです。

 

ダイエットにしろ、資格取得にしろ、最難関は

続けること だと思いませんか?

 

どうやったら、楽しく続けれるのだろう・・・

 

  _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

  

【Excel/VBA 01...Personal Macro Workbook and Developer Tab】

【Excel/VBA 01】

※Please correct my English if you find any mistakes.  Thank you.

f:id:tuna-kichi:20200223230704p:plain

 

You will be able to run any macros if they are written on the 

"Personal Macro Workbook" to any Excel files opened on your PC.

 

 

 

_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

Creating Personal Macro Workbook

 

You can create Personal Macro Workbook from [Record Macro].

Display it in the bottom left of the corner.

This is very useful and I frequently use it to find the VBA code.

  

f:id:tuna-kichi:20200308222021p:plain

 

Once the icon appears, click it and start [Macro Recording] .

Change [Store macro in] to "Personal Macro Workbook", and click [OK].

 

f:id:tuna-kichi:20200308222641p:plain

 

The display will return to Excel when the [Record Macro] window  disappeared.

The [Record Macro] icon will be turned to stop recording button, so click it and stop recording. 

It is okay recording nothing.

f:id:tuna-kichi:20200121153302p:plain

 

 

You just created [Personal Macro Workbook].

You don't have to much care where it stored but the book was created in following folder with the name of "personal.xlsb".

C:\Users\(acount name)\AppData\Roaming\Microsoft\Excel\XLSTART

 

You will write macros in this book with VBA.

This book relies on a local PC (it is not accurate though). Therefore, when you run a macro on an Excel file that is open on your PC, the macro will give results only.

 

_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

Developer Tab

Next, show the "Developer Tab" which includes VBE (Visual Basic Editor) icon.

 

Click open space on the Ribbon.

f:id:tuna-kichi:20200314235837p:plain

 

Put the check mark on "Developer" and hit OK.

f:id:tuna-kichi:20200315000055p:plain



 You will see "Develper Tab" next to the View tab.

f:id:tuna-kichi:20200315000252p:plain

VBE will start from the icon in red rectangle.

 

_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

Ready!

 

You should be ready for beating your tasks.

Excel will do your work using macros on the Personal Macro Workbook instead of you.

 

You can find better explanation on the internet.  Check them out too.

 

Next is write codes, set it, and use it.

 _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

 

Extra

Using two mice. 

 

I have used two mice at the office.

I bought this some years ago.

This mouse has five buttons and I love it.

 

 

I used a chair without armrest before, and my right wrest and arm getting painful.

 

I asked my supervisor if I could exchange the armchair, and I got one. 

 

I also told him that I'm going to change the mouse because that might get hurt my arm.

He responded me "I can buy one for you by department budget, if our manager approve it."

I was surprised that I really have such benefit because I'm not a permanent employee here.

 

 

I got the list which the department can buy from

and I checked one below on the net.

 

This is wireless trackball mouse.

 

 

I reached "Trackball mouse" and "Ergonomic mouse" on the net with the keywords "Tendonitis", and "Mouse".

(I was interested in below one but it was not on the list.)

 

 

I got Logicool MT570 which has five buttons,

and it is bit bigger, so this might difficult to operate for ladies or people

who has smaller hand.

 

However, this is good for me to reduce the Tendonitis.

 

I guessed that I take time to get use to it,

so I left old one and use them in parallel, but this is better than I thought.

  

 

The trackball mouse fixes in one place basically,

and the pointer is operated by rolling the ball.

 

I use two 24 inches monitors so it sometimes hard to move one edge to the other.

 

The pointer cannot be reached the edge by one rolling the ball but it needs three

even though the pointer speed sets as the fastest.

 

I use the wired mouse to move long distance in such situation.

 

 

The trackball mouse works well within a single monitor,

and it works better for ditailed work by pinching and moving the ball by both hands,

such as adjusting row height or column width.

  

 

I use the trackball as main and wired one for moving long distance.

No more arm and wrest pain with the trackball mouse and the armchair,

those two mice works well.

 

 

In my opinion, this is same as using two functions of Excel formulas simultaneously,

like incorporate "Match" formula in "Vlookup".

 

Combining multiple things make far better sometimes.

  _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

 

 

 

 

 

【English 1】

Hello.

This is just my excise of English writing.

I re-wrote this article from one of my blog in Japanese [英語のこと1].

Please correct my English if you know it and found any.
www.tuna-kichi.com

 

f:id:tuna-kichi:20200211075717p:plain

 

 

I'm sometimes asked that "Can you teach English to me?"

or "What kind of study method is more efficient?". 

 

I will answer "Practical training is good" for the question,

although I'm not sure what I answered before.

 

 

I tell them "study English by yourself and use it to me what you learned.

What you need is the opportunity to use it in a real situation.

Whatever ever you like conversation or sentence like an e-mail.

 

 

Those won't improve their English skills

with learning grammar or doing homework

even though there teachers have excellent teaching skills.

We did that six years when we are junior high through high school students.

 

 

I believe the way won't work well after graduate.

Those must have a particular goal with enthusiasm.

 

 

So, I hope the following article makes people

who are thinking to start learning English.

 

_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

 

 

I will write my average weekday.

 

 Morning

before leave home

 

I wake up with the first alarm,

which I set on 4th generation iPod, ring at five-thirty.

Then I get up about twenty minutes later the first one rang.

 

None of my family members get up at this time. 

 

Go to the bathroom and brush my teeth.

 

 

Then go to the kitchen and turn on a Tifal to boil the water and set the coffee.

Take out a frozen meal from the fridge and warm it in the microwave.

 

 

Pour the boiled water into the mug for coffee.

Pack the rice and thawed meal in the lunch box.

This is for my lunch that I will eat at the office.

 

After that, I prepare breakfast.

Thawed deep-fried chicken, and put it on rice.

 

[商品価格に関しましては、リンクが作成された時点と現時点で情報が変更されている場合がございます。] [商品価格に関しましては、リンクが作成された時点と現時点で情報が変更されている場合がございます。]  

(This is taste good)

 

Coming back to my room and watch an English movie (about ten minutes long)

or read an English article while eating breakfast.

 

 

Bring back the dish to the kitchen and start changing clothes.

 

Put on the suit after shaving and

put the wallet and handkerchief in the back of the pants 

 

 

 

Put the lunch box and a bottle of water in the backpack.

Turn off the light and see you tonight.

 

 

at work

 

Buy a snack at the convenience store where the nearest train station to the office.

Fifteen min. walk to the office from here.

 

 

Arriving at the office where is on the sixth floor around eight o'clock

but work starts at nine.

Make a cup of coffee and eat snack bread little which I just bought at the store.

 

 

Go to "Yahoo USA" and read one or two paragraphs of an article.

Then visit "Yahoo Japan" to do the same thing as "Yahoo USA".

That will be about eight twenty or thirty.

 

 

I will write a draft for the blog if I still have time.

At eight-thirty, put my iPhone in my breast pocket and take nap.

 

 

I will get up when my iPhone's alarm rang two minutes before nine

and start work.

 

 

 

Noon

Go to the cafeteria walking down the staircase to the third floor

for eating the lunch which I packed this morning. 

 

Lunch break is forty-five min.

About thirty min. left when I come back to the sixth floor from the cafeteria.

Of course, I take nap.

 

 

Eat snack bread at 3 o'clock, and eat another one

when I hear chime at 17:30.

 

However, I have to do overtime until 8 o'clock.

  

 

Night

home

 

Take about one hour commute.

Arrive home about nine when I left office eight.

 

 

I take a shower as soon as I got home and have dinner.

I don't eat a lot because I take 30 to 1 hour to fall asleep if I'm full.

I eat more cabbage instead of rice.

 

  

Probably, some people think it is sarcasm but that made me lose weight......

However, I want to gain more weight.

This is actually one of my problems......

 

 

I know many people want to lose weight but like me,

some people think want to gain weight.

 

 

 

Take about 30 min to 1-hour break and then go to the bed.

Have a nice dream.

 

 

 _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

 

Conclusion 

How about my writing skill?

I'm not good at grammar things and don't have much vocabulary.

 

They are probably junior high students' level 

 

 

However, this is enough for casual conversation,

communication with colleagues, or people who are from partner companies.

 

 

(こんな書籍もあります)

 

 

I have worked with non-English-native

such as Korean, Chinese, or southeast Asian 

who have studied English and got their skills.

 

Simple English worked better than using something difficult

grammar, phrase, or vocabulary for them

  

 

This works well for native English-speakers even though it might be something childish.

We all know we can communicate with Japanese teenagers

with the Japanese language without problem.

 

This should happen in English too.

 

  _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

 

 

【英語のこと1】

Hello.

今日は、Englishについて write します。

 

f:id:tuna-kichi:20200211075717p:plain

 tuna-kichi は時々知り合いに

「英語を教えて」とか「どんな勉強方法が効果的?」

って聞かれることがあります。

 

以前は何て答えていたか、覚えていませんが、最近は

「プラクティカル トレーニングが良いです」

って答えています。

 

プラクティカル トレーニング (Practical Training)

つまり、実戦練習です。

勉強は本人に頑張ってやってもらって、

勉強したことを tuna-kichi に使ってください ってことです。

会話でも、文章(メール)でも。

 

いくら、教える方が、文法を教えたり、宿題を出して採点したりしても

それでは上達しない人がほとんどなのです!

だって、(ほとんどの人は)中学・高校の6年間

その方法で英語を勉強してきたんでしょ?

 

卒業してからまた同じことしても、ちゃんと目標持って

気合入れてやっていかないと身に付きませんから~。

(ざんねーん!・・・(わかる人いるかな?))

 

ということで、ここからの文章は、「英語の勉強を始めようかな」

と思ってもらいたい、英語アレルギーの人に半歩でも近づいてほしいな 

という思いで書きます。

 

 

_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

Caution: 

ここからの文章は、あくまでも遊び感覚でお読みください。

正しい英語が身に付きませんので、 お気を付けください。 

でも、「どんな状況で、どんな単語を使用することができるか」 

ということはわかると思います。

 

 

Difficult な文章は tuna-kichi も write できませんので、

tuna-kichi の average な weekday の一日をご紹介いたします。

 

 Morning

before leave home

iPod touch 第4世代に set した最初の alarm が

5時半に ring して、それで wake します。

その約20 minuites 後に bed から get up。

 

この時間は、family の nobody が get up してます。

 

起床後、 bathroom に行ってから、歯を blush します。

 

そのあと、kitchen に go して、

ティファールの switch を turn on して、

drip coffee を set して、

fridge から frozen のお弁当のおかずを microwave でチンして解凍。

(チンって通じるかな?)

 

お湯が沸いたら、set しておいた coffee に boiled waterを pour。

Lunch box を取り出して、rice とチンしたおかずを pack する。

これで、office で eat する today の lunch 完成。

 

あとは、microwave  でチンした frozen 唐揚げを 

茶碗に軽く一杯の rice に on !

これが breakfast。

 

(これが taste good ですよ)

my room に return して、breakfast を eat しながら、

English の movie(10 minutes くらい)を watch したり、

English の article を read。

 

breakfast が finish したら、茶碗を kitchen に return して、

身支度 start。

 

shaver でひげ剃ってから、suit に着替え。

folding wallet と handkerchief をズボンの back の pocket に in。

winter の season は neck warmmer と scarf もつけます。

iPhone と keys と eye drop も持って と。

 

backpack に lunch box と water を入れたペットボトルを

しまって room の電気を turn off して 

 

行ってきまーす。

 

at work

会社の nearest station の近くのファミマで、addtional の breakfast

とおやつになるパンをペイペイで pay して、会社まで約15分の walk

 

office は 6th floor。

work の start は 9 o'clock からだけど、

大体、一時間 before には会社に arrive してます。

給湯室でお湯もらって、インスタント coffee 作って、

ファミマで買った5個入りのパンを一個 eat します。

 

PC 立ち上げたら yahoo USA に行って 

適当な news を read。 でも、全部 read すると 疲れちゃうから、

いつも大体 1 paragraph read したら yahoo Japan へ。

ここまでやって、8時20~30分くらい。

 

余裕があったら、ブログの article の draft を書きすすめる。

8時半くらいになったら、iPhone を shirt の胸ポケットに入れて、

30分くらい nap する。

 

9時 two minutes before になったら 

iPhone の alarm が ring するから起きて、 work start です。

 

Noon

lunch の 時間になったら、

朝詰めたお弁当を持って 3rd floor の食堂で eat。

食堂までは、staircase を使って降りていきます。

 

lunch break は45分間。

lunch を 3F で eat して、6F に came back すると

残りの時間は30分くらい。

of course, お昼寝。

 

15時頃に、おやつ。

5個入りのパンをひとつ eat。

これで left 3個。

 

17時半の終了のチャイムが ring したら、

残りのパンを パク パク パク

20時くらいまで overtime work です。

 

Night

home

commute 時間は約1時間。

20時に office から leave するから 21時頃に came home。

 

came home したらまず take shower して、それから dinner。

dinner でいっぱい eat しちゃうと、寝つきが悪いせいもあって

すぐに sleep できないから、どんぶりにキャベツの千切りを 

half くらい入れて、 rice ちょこっとにして eat。

おかずも食べ過ぎないように少しだけ。

 

そのせいで、 weight は lose しました・・・

こんなこと書いたら「嫌味だ」って思う人もいるかもしれないど、

 tuna-kichi は weight をもっと gain したい・・・

 

世の中は、weight を lose したい人が多いかもしれませんが、

増えなくて悩んでいる人もひそかにいるのです。

 

dinner が finish したら、30分から1時間くらい休憩して、

おやすみなさい zzz

 _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

 

まとめ

どうでしょう?

日本語の文法のままで、一部の単語を英語に交換しているだけです。

今回、置き換えた英単語はそんなに難しくないと思います。

 

中学生程度の単語です。

 

実際、日常英会話や、仕事で、顧客が相手ではない場合に

使用する英語は中学生レベルで十分です。

 

(こんな書籍もあります)

 

 

 tuna-kichi が仕事で英語を使っていた時の相手は、

韓国、中国、東南アジアの人たちがほとんどで、

その人たちも tuna-kichi と同じように勉強して英語を身に着けた人たちでした。

中には「仕事で使うから仕方なく勉強している」 

と感じる英語を使う人もいました。

 

つまり、そのような人たちに対して、高校生レベルの文法や言い回し、

英単語を使用すると相手に通じないことが発生してしまいます。

なので、簡単な単語でシンプルな中学生レベルの文章の方が

トラブルも少なくコミュニケーションが取れるのです。

 

中学生レベルの単語や文法を身に付ければ、稚拙かもしれませんが、

英語ネイティブにも通用します。

 

だって、日本人の中学生と日本語で問題なく会話できますもの。

英語だって同じですよ。

  _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/