Upcoming SlideShare
×

# Excelマクロ 2

375 views

Published on

Published in: Technology
1 Like
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

Views
Total views
375
On SlideShare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
5
0
Likes
1
Embeds 0
No embeds

No notes for slide
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• ### 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