Excel VBAã§ï¼ã°ã©ããèªåã§æç»ãããï¼ãã¼ã¿ç¯å²ãåçã«å¤ããï¼ãï¼ãã½ããã¦ã§ã¢ã®å質ä¿è¨¼ã«ã¤ãã¦
Excel VBAã®ãã¯ãã§ï¼ã°ã©ããèªåçã«æç»ããæ¹æ³ã
æåã§ã°ã©ããæããã¨ããã¨ï¼ãã¼ã¿ç¯å²ã®è¨å®ãªã©ããã¡ãã¡é¢åãããã
ããããã¯ãã§èªååãããã
ãªã¢ã«ã¿ã¤ã ã§ç¶æ³ãå¤åãã¦ããä¸ã§ï¼ç¾ç¶ãåæ ãããææ°ãã¼ã¿ã®ã°ã©ãããèªåçã«ä½ãããã®ã ã
ï¼ï¼ï¼ã°ã©ãã®ãµã³ãã«ãã¼ã¿
ã·ã¼ãä¸ã«ï¼ãããããã¼ã¿ãããã¨ãããã
x軸ã®æ°å¤ï¼æï¼ | ç³»å1 | ç³»å2 |
3 | 10 | 20 |
4 | 20 | 10 |
5 | 10 | 10 |
6 | 30 | 40 |
7 | 40 | 20 |
8 | 20 | 20 |
ãã ãç³»å1ã®3æã®ãã¼ã¿ã¯ï¼ã·ã¼ãä¸ã§8è¡3åç®ã«ããã¨ããã
ããã§ï¼ãã®ãã¼ã¿ã¯ãæ¯æå¢ãã¦ãããã¨ããç¹ã«æ³¨æãããã
x軸ã¯ãæãã ããï¼ä»å¾æ¯æï¼è¡ã¯å¢ããå¯è½æ§ãããã
ãã¼ã¿ãæ¸ãã¦ããç¯å²ãèªåçã«è¦æ¥µãã¦ï¼ãã®ç¯å²ã«å¿ããã°ã©ããä½ãããã
ï¼ï¼ï¼ã°ã©ããèªåçã«æç»ããVBAã®ãµã³ãã«ã³ã¼ã
ä¸è¨ã®VBAã³ã¼ããå®è¡ããã°ããã
Sub ã°ã©ãæç»() ' ---------- è¨å® ---------- ' ä¸ã¤ã®ç³»åã¯ä¸æ¹åã«å»¶ã³ãã¨ããã ' æãå·¦ã«ãããã¼ã¿ç³»åã®å·¦ã®åã«ã¯ï¼é ç®è»¸ãããã¨ããã ' ã·ã¼ãä¸ã§ã®ãã¼ã¿è¨è¿°éå§ä½ç½® y_offset = 8 x_offset = 3 ' ãã¼ã¿ã®ç³»åã®æ° (x_offsetåç®ããå³ã¸ä½å並ãã§ããã®ã) series_num = 2 ' ç³»åã®åå series_names = Array("1åç®ã®ç³»å", "2åç®ã®ç³»å") ' ã°ã©ãã®ã¿ã¤ãã« chart_title = "hogeã«é¢ããã°ã©ã" ' 軸ã®ã¿ã¤ãã« x_title = "x軸" y_title = "y軸" ' ã°ã©ãã®ä½ç½® gpos_x = 300 gpos_y = 50 ' ã°ã©ãã®ãµã¤ãº g_width = 400 g_height = 300 ' ã°ã©ãèå¥å graph_name = "my_graph" ' ---------- ã°ã©ãä½æ ---------- ' ã¢ã¯ãã£ãã·ã¼ãä¸ã«æ¢åã®ã°ã©ããããã°åé¤ If ActiveSheet.ChartObjects.Count > 0 Then For i = 1 To ActiveSheet.ChartObjects.Count ' ã°ã©ãåãä¸è´ããã If ActiveSheet.ChartObjects(i).Name = graph_name Then ActiveSheet.ChartObjects(i).Delete Exit For End If Next i End If ' ãã¼ã¿ç¯å²ãæ±ºå® (ä½è¡ç®ã¾ã§ããã®ã) y_temp = y_offset continue_flag = True Do While continue_flag = True ' ãã®è¡ã«å 容ãããã°æ¬¡ã®è¡ã¸é²ã If Len(Cells(y_temp, x_offset).Value) > 0 Then y_temp = y_temp + 1 Else continue_flag = False End If Loop y_end = y_temp x_end = x_offset + series_num - 1 ' ã°ã©ããæç» ' http://brain.cc.kogakuin.ac.jp/~kanamaru/lecture/vba2003/13-applications02.html ' http://www.officepro.jp/excelvba/chart_edit/index2.html Dim chartObj As ChartObject Set chartObj = ActiveSheet.ChartObjects.Add( _ gpos_x, gpos_y, g_width, g_height _ ) chartObj.Name = graph_name With chartObj.Chart ' ãã¼ã¿ç¯å²ãã»ããï¼å·¦ä¸ã¨å³ä¸ï¼ .SetSourceData ActiveSheet.Range( _ Cells(y_offset, x_offset), _ Cells(y_end, x_end) _ ), xlColumns ' x軸ã®é ç®è»¸ç¯å²ãã»ãã .SeriesCollection(1).XValues = Range( _ Cells(y_offset, x_offset - 1), _ Cells(y_end, x_offset - 1) _ ) ' ãªãã·ã§ã³ãã»ãã .ChartType = xlLine ' æãç· .HasTitle = True .ChartTitle.Characters.Text = chart_title .Axes(xlCategory, xlPrimary).HasTitle = True .Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = x_title .Axes(xlValue, xlPrimary).HasTitle = True .Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = y_title ' ç³»ååãã»ãã For i = 1 To series_num .SeriesCollection(i).Name = series_names(i - 1) Next i End With ' æç»çµãã End Sub
è¨å®ã®é¨åã¯ã好ã¿ã§ã
å®è¡ããã¨ï¼ã·ã¼ãä¸ã«ã°ã©ããç¾ããã
ãªãï¼æ°å¤ãé åå½¢å¼ã§ä¸ãã¦ã°ã©ããæãäºãã§ããã
æ°å¤ãç´æ¥ã³ã¼ãããã«æå®ãã¦ã°ã©ããä½æããã«ã¯ï¼
http://park11.wakwak.com/~miko/Excel_...
ï¼ï¼ï¼ã©ãããå ´åã«å¿ è¦ãï¼
éçºã®ç¾å ´ã§ã¯ï¼
- æ®ãã°æ°
- æ¶åæ¸ã¿ãã¹ãã±ã¼ã¹æ°
- å®è£ æ¸ã¿æ©è½æ°
ãªã©ã®é²æãã°ã©ãã«ãããå ´åããããï¼ããããæã«ä½¿ããã ããã
è£è¶³ï¼ã½ããã¦ã§ã¢éçºã«ãããå質ä¿è¨¼
æ®ãã°æ°ã«ã¤ãã¦ã®è©±ãåºãã®ã§ï¼å質ä¿è¨¼ã«ã¤ãã¦å°ãã
ã½ããã¦ã§ã¢ã®å質ã«ã¤ãã¦åå¼·ãããï¼ã¨æã£ã¦èª¿æ»ãã¦ã¿ãã¨ï¼è¦ã¤ããè³æã¯å¤§æµããããèªã§æ¸ãã¦ãããã¤ã¾ã
è¿ éãã¤é©åã«å¯¾å¦ãããã¨
ã¨ãã£ãï¼ä¸èº«ã®ãªãåé·ãªæç« ã§åãå°½ãããã¦ããã¨ãããã¨ã ã
ä¸å¿ä¸è¨ã§æ¦è¦ãè¦ã¦ã¿ããã
Wikipedia:å質ä¿è¨¼
http://ja.wikipedia.org/wiki/%E5%93%8...
ã½ããã¦ã§ã¢ã®å質ä¿è¨¼
http://www.rsch.tuis.ac.jp/~tamaki/so...
ã½ããã¦ã§ã¢å質ä¿è¨¼ã¯ç¶ç¶çãªããã»ã¹
http://techtarget.itmedia.co.jp/tt/ne...
ããããè¦ç´ããã¨ï¼ã½ããã¦ã§ã¢ã®å質ã確ä¿ããããã«ã¯ã»ã»ã»
- é©åã«ãã¹ãå·¥ç¨ãè¡ããã¨
- åã¿ã¹ã¯åã«é©åãªè¦ç´ãå®ãããã¨
- åã¿ã¹ã¯å¾ï¼ã¾ãã¯ãã®éä¸ï¼ã«é©åãªã¬ãã¥ã¼ãå®æ½ãããã¨
- ã¤ã³ã·ãã³ãã®å¦çããã¼ãé©åã«å®ãã¦éµå®ãããã¨ï¼BTSå©ç¨ãITIL風ã®ä½å¶å°å ¥ï¼
ãæ±ããããã
çµå±ï¼ãã¹ããã¬ãã¥ã¼çã®ãåè«ããç·åãã¦æ±ã£ãã®ãå質ä¿è¨¼ãªã®ã ã
åã ã®ã¨ã³ã¸ãã¢ãå ·ä½çãªå¯¾çãåã£ã¦ããç©ã¨ãã¦ã¯ï¼ä¸çªç®ã®ãã¹ãå·¥ç¨ãæããããã ããã
ãããï¼ãã¹ãå®è¡ã®ããã®ãã¼ã«ãã³ã¼ãã£ã³ã°ä½æ³ã«ã¯è©³ããã¦ãï¼ãã¹ãçµæã®å¦¥å½æ§ãæ°å¤çã»çµ±è¨çã«æ¤è¨¼ã§ããã¨ãã人ã¯å°ãªãã®ã§ã¯ãªããããã
ï¼â»ãã¡ãããããã£ãæ¤è¨¼çµæãåºããã¨ããã§ï¼ä¿¡é ¼æ§ã¯ã¾ãå¾®å¦ãªã®ã ãâ¦ï¼
ãã¹ãçµæãè¦ã¦
ãã®ã½ããã¦ã§ã¢ã¯ä¸å®ã®å質åºæºãæºãããããï¼ãããã¹ãã®å¿ è¦ã¯ãªã
ã¨ä¸»å¼µã§ããæ ¹æ ãä½ãããã°ä¾¿å©ãããããªãã
ãã®ããã®éå ·ã®ä¸ã¤ããã°åææ²ç·ã
- æå»ã¨å ±ã«ï¼çºè¦æ¸ã¿ãã°ã®åæ°ãã©ãå¤åãããï¼
ãã°ã©ãã«ãã¦ï¼ä½ããã®é¢æ°ããã£ããããããã®ã
ããã°ã©ã ãã°ã®æé·æ²ç·ã«ã¤ãã¦ï¼æ°å¼ã«ãã解説ä»ãï¼
http://www.ne.jp/asahi/jul/1632/Ochib...
å帰ãããé¢æ°ã¨ãã¦ã¯ã´ã³ãã«ãæ²ç·ï¼ã·ã°ã¢ã¤ãé¢æ°ãªã©ãããã
ãã¹ãå·¥ç¨ã®ãã¨ã®ã»ãã«ãªã£ã¦ï¼æ°è¦ãã°çºè¦ä»¶æ°ãæ¸ã£ã¦ããã¨ï¼ã°ã©ãã®å½¢ç¶ãå¹³ãã«ãªã£ã¦ããã
ãã®å¹³ãå æ¸ã®åº¦åãã«ãã£ã¦ï¼ãã¹ãã®ãããæãããããã¨ããããã ã
ï¼ãã ãï¼å¸¸ã«æéã¨å
±ã«ãã°ãä¸å®ã®å²åã§è¦ã¤ããã¨ããåæã®ä¸ã§ã ãã»ã»ã»ï¼
ä¿¡é ¼åº¦æé·æ²ç·
http://ja.wikipedia.org/wiki/%E4%BF%A...åæãè¦ãå ´åã«ã横軸ã«æ¥ä»ã使ã£ãå ´åããã¹ãããã¦ããªããããã°ãåºãªãã®ãããã¹ãããã¦ããã°ãåºãªãã®ãã®åºå¥ãã¤ããªãã¨ããåé¡ãããã
ä¸ã¤ã®ç®å®ã«ã¯ãªãã ããã
è£è¶³ï¼
ãã®ãã¼ã¸ãä»ã®æ¹ã«ç´¹ä»ããéã«ã¯ï¼
ããExcel VBA ã°ã©ãæç»ãã§ã°ã°ã£ã¦ä¸çªä¸ã«æ¥ããã¼ã¸ãåç §ãã¦ãã ãããã
ã¨è¨ãã
é¢é£ããè¨äºï¼
ããã¥ã¡ã³ãä½æã楽ã«ããããã®ï¼Excel VBA é »åºï¼ãã¿ã¼ã³
http://language-and-engineering.hatenablog.jp/entry/20090401/p1
Excel VBAã®ãã¯ãã§ï¼IEãèªåæä½ããããï¼DOMã»ã¬ã¯ã¿é¢æ°ãVBAã§èªä½ï¼
http://language-and-engineering.hatenablog.jp/entry/20090710/p1
Excel VBAã®ãã¯ããï¼è¤æ°ã®ããã¯ããå©ç¨ããæ¹æ³ ï¼æ¨æºã¢ã¸ã¥ã¼ã«ãããã¯ã®å¤é¨ã§ç®¡çãã¦ï¼å ±éã©ã¤ãã©ãªã¨ãã¦èªã¿è¾¼ã¿ï¼
http://language-and-engineering.hatenablog.jp/entry/20090731/p1
Word VBA ã®å ¥éç¨ãªã³ã¯éãï¼ã¯ã¼ããã¯ãã®ï¼ãµã³ãã«ã³ã¼ãããªãã¡ã¬ã³ã¹ï¼
http://language-and-engineering.hatenablog.jp/entry/20100314/p1
ãããè·äººã«ãªãããï¼Windowsã¨Linuxä¸ã§ã®éçºæ¥åãèªååãããã¦ãã¦éï¼ - 主ã«è¨èªã¨ã·ã¹ãã éçºã«é¢ãã¦
http://language-and-engineering.hatenablog.jp/entry/20110904/p1