Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Excelマクロ 2

505 views

Published on

Published in: Technology
  • Be the first to comment

Excelマクロ 2

  1. 1. Excel 2 ( ) 2012/02/16
  2. 2. MyMacro.xlsm Del_LF_TAB
  3. 3. Dim i As Integer, j As IntegerDim rowNum As IntegerDim ORG As StringrowNum = Range("A65536").End(xlUp).Row A End(xlUp).Row (https://www.moug.net/tech/exvba/0050088.html)
  4. 4. For i = 1 To 2 For j = 1 To rowNum ORG = ActiveSheet.Cells(j, i).Value ORG = Replace(ORG, vbTab, " ") ORG = Replace(ORG, vbCrLf, " ") ActiveSheet.Cells(j, i).Value = _ Replace(ORG, Chr(10), " ") Next jNext i i (1 2 =A&B ) J (1 rowNum )
  5. 5. For i = 1 To 2 For j = 1 To rowNum ORG = ActiveSheet.Cells(j, i).Value ORG = Replace(ORG, vbTab, " ") ORG = Replace(ORG, vbCrLf, " ") ActiveSheet.Cells(j, i).Value = _ Replace(ORG, Chr(10), " ") Next jNext i Cells(j,i) String Replace vbTab vbCrLf Chr(10) Cells(i,j)
  6. 6. VBA ( )vbTabChr(9)vbCrLfChr(13) + Chr(10)vbLfChr(10)http://www.red.oit-net.jp/tatsuya/vb/fixed.htm
  7. 7. ReplaceVBA Replace F1
  8. 8. Replacehttp://officetanaka.net/excel/vba/function/replace.htm
  9. 9. A BAvbTabvbCrLfvbLf
  10. 10. MyMacro.xlsm SplitString
  11. 11. (Const)A
  12. 12. AInStrRev scharLeft Mid InStrRev BC D
  13. 13. InStrRev : if pos = 0
  14. 14. Left
  15. 15. Mid
  16. 16. InStr
  17. 17. http://www.eurus.dti.ne.jp/yoneyama/Excel/vba/function/vba_string.htmlhttp://www.eurus.dti.ne.jp/yoneyama/Excel/vba/function/vba_string2.html⇧http://officetanaka.net/excel/vba/function/
  18. 18. sample.xlsm A ’¥’ (sheet1) (sheet2) : /
  19. 19. MyMacro.xlsm

×