SlideShare a Scribd company logo
1 of 39
Excel
        2012/01/23
:

^(d{3}[357])(.*?)      (.*?)    (([0-9a-zA-Z ]+?))(.*   )$


12    3    (1_4_3)5


S

([0-9]{3}(3|5|7))>(.*)         (.*)   ((.*))(.*)


1>2    3    (1_4_3)5


T

^([0-9]{3}[357])(..*?         )(..*)(   .*()([0-9a-zA-Z ]*)().*   )$


$1$2$3$4$1_$5_$3$6
[   ]
[   ]
[        ]



=>
             /




[    ]
=>
Alt+F11           VBA


                  [                ]
      Module1


(         Mac                Win
[             ]             [???????]   )
Sub Macro1()
'
' Macro1 Macro
'
    Range("C3").Select
    ActiveCell.FormulaR1C1 = "foo"

    Columns("D:D").Select
    Selection.Insert _
    Shift:=xlToRight,CopyOrigin:=xlFormatFromLeftOrAbove

    Range("A1").Select

    Cells.Find(What:="foo", After:=ActiveCell, LookIn:=xlFormulas,
    LookAt:= xlPart, SearchOrder:=xlByRows, _
    SearchDirection:=xlNext, MatchCase:=False, _
    MatchByte:=False, SearchFormat:=False).Activate

End Sub

                     1. C3   ”foo”
                     2. D
                     3. “foo”
Sub              (<arg *optional>)


      <         >


End Sub




(                                       )


      : Sub          Function         VBA             xls


          =Foo(A1)                   Function “Foo”
http://www.asahi-net.or.jp/~ef2o-inue/vba_k/
sub04_020.html
VBA
Dim   i As Integer
Dim   columnInternal As String
Dim   columnInvoicedAmt As Double
Dim   rowNum As Boolean
Dim   tmp As Variant

Dim <      > As <       >




          Option Explicit




http://www.asahi-net.or.jp/~ef2o-inue/vba_k/sub04_040.html
http://www.asahi-net.or.jp/~ef2o-inue/vba_k/sub04_050_06.html
(                     )
   Integer               String

   Long                  Date

   Single                Object

   Double                Variant

   Currency              Boolean




http://excelvba.pc-users.net/fol5/5_2.html
=


a = 100
                a        100
                     a ← 100
          a              100


    i = i + 1
      i                    i    1
 :i = 2             i = i + 1        i = 3



http://home.att.ne.jp/zeta/gen/excel/c04p22.htm
If   (   )
(     )
=:     =:

+:     <>:

-:     >:

*:     >=:

/:     <:

mod:   <=:

^:
if
(if                                 )
If        1 Then
           1
ElseIf          2 Then
           2
Else
           1          2
End If
*ElseIf        Else



http://excelvba.pc-users.net/index.html
   6



http://excelvba.pc-users.net/fol6/6_1.html
http://www.asahi-net.or.jp/~ef2o-inue/vba_k/sub04_050_02.html
:
If Cells(1,1).Value = 1 Then
     Cells(1,2).Value = “Foo”
ElseIf Cells(1,1).Value = 2 Then
     Cells(1,2).Value = “bar”
Else
     Cells(1,2).Value = “hoge”
End If

         Cells(1,1) (    A1)          -
1         Cells(1,2) (    B1)             “Foo”
2         Cells(1,2) (    B1)             “bar”
              Cells(1,2) (      B1)           “hoge”



ElseIf
(                                                      )
For   Next
(      if
              )


For               =   To


Next

        For                          i    j




http://excelvba.pc-users.net/fol6/6_3.html
http://www.sigoto.co.jp/excel/statement/state09.htm
(For each    Next                        )
:
Dim i As Integer

For i = 1 To 10
     Cells(i, 1).Value = i * 10
     i = i + 1
Next



        i   1           i
(                           )
For i = 1 To 10     Next        i    1     10


Cells(i, 1).Value = i * 10          Cells(i, 1)   i*10
i = i + 1       i   1                                    ”   i
+ 1”
(   2:30...)
xciConvert.xlsm
Alt+F11   VBA


   Before.xls     After.xls
Client          Project Number          Client

Internal %                        %        (+        )

Vendor %                          (+             )

Invoiced Amt       Project Total
      Invoiced Amount    0

Invoiced Amt

GM

Client Name    BU Name       CompDate     BDM

GM%

         :
3
/
Left
http://officetanaka.net/excel/vba/function/Left.htm

InStr
http://officetanaka.net/excel/vba/function/InStr.htm

Offset
http://officetanaka.net/excel/function/function/
offset.htm

CSng
http://officetanaka.net/excel/vba/function/CSng.htm


http://officetanaka.net/excel/vba/function/index.htm
Web
http://officetanaka.net/excel/

http://www.asahi-net.or.jp/~ef2o-inue/menu/
menu04.html

http://www.asahi-net.or.jp/~ef2o-inue/menu/
menu05.html

http://excelvba.pc-users.net/index.html


                     VBA             Web
                                  VBA xxxx
xciConvert.xlsm


Client                 ProjDate
Client                                  A       B
                    Client


         ProjDate                     Project
Number
netapp_1101_008-02 (              )
Excelマクロはじめの一歩

More Related Content

What's hot

Евгений Курбацкий. Зачем нужны зависимые типы
Евгений Курбацкий. Зачем нужны зависимые типыЕвгений Курбацкий. Зачем нужны зависимые типы
Евгений Курбацкий. Зачем нужны зависимые типы
Andrey Vlasovskikh
 

What's hot (20)

C++ Programming - 1st Study
C++ Programming - 1st StudyC++ Programming - 1st Study
C++ Programming - 1st Study
 
PostgreSQL Quiz
PostgreSQL QuizPostgreSQL Quiz
PostgreSQL Quiz
 
Pegomock, a mocking framework for Go
Pegomock, a mocking framework for GoPegomock, a mocking framework for Go
Pegomock, a mocking framework for Go
 
Exception Example in Python
Exception Example in PythonException Example in Python
Exception Example in Python
 
Stl algorithm-Basic types
Stl algorithm-Basic typesStl algorithm-Basic types
Stl algorithm-Basic types
 
C Programming Language Step by Step Part 5
C Programming Language Step by Step Part 5C Programming Language Step by Step Part 5
C Programming Language Step by Step Part 5
 
変数の型 - Java 演習
変数の型 - Java 演習 変数の型 - Java 演習
変数の型 - Java 演習
 
Burrowing through go! the book
Burrowing through go! the bookBurrowing through go! the book
Burrowing through go! the book
 
C Programming Language Part 4
C Programming Language Part 4C Programming Language Part 4
C Programming Language Part 4
 
Code
CodeCode
Code
 
20180721 code defragment
20180721 code defragment20180721 code defragment
20180721 code defragment
 
Import data from csv excel file and export to xml excel file in c programming
Import data from csv excel file and export to xml excel file in c programmingImport data from csv excel file and export to xml excel file in c programming
Import data from csv excel file and export to xml excel file in c programming
 
20180310 functional programming
20180310 functional programming20180310 functional programming
20180310 functional programming
 
Basic use of Python
Basic use of PythonBasic use of Python
Basic use of Python
 
How the stack works(1)
How the stack works(1)How the stack works(1)
How the stack works(1)
 
Евгений Курбацкий. Зачем нужны зависимые типы
Евгений Курбацкий. Зачем нужны зависимые типыЕвгений Курбацкий. Зачем нужны зависимые типы
Евгений Курбацкий. Зачем нужны зависимые типы
 
Data Structure - 2nd Study
Data Structure - 2nd StudyData Structure - 2nd Study
Data Structure - 2nd Study
 
20181020 advanced higher-order function
20181020 advanced higher-order function20181020 advanced higher-order function
20181020 advanced higher-order function
 
Integers slidecast
Integers slidecastIntegers slidecast
Integers slidecast
 
OREO - Hack.lu CTF 2014
OREO - Hack.lu CTF 2014OREO - Hack.lu CTF 2014
OREO - Hack.lu CTF 2014
 

Viewers also liked (8)

ピボットテーブル02
ピボットテーブル02ピボットテーブル02
ピボットテーブル02
 
How to use hiatus
How to use hiatusHow to use hiatus
How to use hiatus
 
Excelマクロ 2
Excelマクロ 2Excelマクロ 2
Excelマクロ 2
 
正規表現のいろは
正規表現のいろは正規表現のいろは
正規表現のいろは
 
TTX+tools
TTX+toolsTTX+tools
TTX+tools
 
ピボットテーブル01
ピボットテーブル01ピボットテーブル01
ピボットテーブル01
 
Rubyスクリプト
RubyスクリプトRubyスクリプト
Rubyスクリプト
 
AdvancedなExcel活用講習会
AdvancedなExcel活用講習会AdvancedなExcel活用講習会
AdvancedなExcel活用講習会
 

Similar to Excelマクロはじめの一歩

Similar to Excelマクロはじめの一歩 (20)

Functions In Scala
Functions In Scala Functions In Scala
Functions In Scala
 
A Few of My Favorite (Python) Things
A Few of My Favorite (Python) ThingsA Few of My Favorite (Python) Things
A Few of My Favorite (Python) Things
 
Idioms in swift 2016 05c
Idioms in swift 2016 05cIdioms in swift 2016 05c
Idioms in swift 2016 05c
 
functions
functionsfunctions
functions
 
Funkcija, objekt, python
Funkcija, objekt, pythonFunkcija, objekt, python
Funkcija, objekt, python
 
T3chFest 2016 - The polyglot programmer
T3chFest 2016 - The polyglot programmerT3chFest 2016 - The polyglot programmer
T3chFest 2016 - The polyglot programmer
 
Swift Rocks #2: Going functional
Swift Rocks #2: Going functionalSwift Rocks #2: Going functional
Swift Rocks #2: Going functional
 
Functions, Types, Programs and Effects
Functions, Types, Programs and EffectsFunctions, Types, Programs and Effects
Functions, Types, Programs and Effects
 
Scalapeno18 - Thinking Less with Scala
Scalapeno18 - Thinking Less with ScalaScalapeno18 - Thinking Less with Scala
Scalapeno18 - Thinking Less with Scala
 
Mcq cpup
Mcq cpupMcq cpup
Mcq cpup
 
NetPonto - The Future Of C# - NetConf Edition
NetPonto - The Future Of C# - NetConf EditionNetPonto - The Future Of C# - NetConf Edition
NetPonto - The Future Of C# - NetConf Edition
 
C cheat sheet for varsity (extreme edition)
C cheat sheet for varsity (extreme edition)C cheat sheet for varsity (extreme edition)
C cheat sheet for varsity (extreme edition)
 
Clojure Intro
Clojure IntroClojure Intro
Clojure Intro
 
ClojureScript loves React, DomCode May 26 2015
ClojureScript loves React, DomCode May 26 2015ClojureScript loves React, DomCode May 26 2015
ClojureScript loves React, DomCode May 26 2015
 
Elixir @ Paris.rb
Elixir @ Paris.rbElixir @ Paris.rb
Elixir @ Paris.rb
 
Functional programming
Functional programmingFunctional programming
Functional programming
 
ZIO: Powerful and Principled Functional Programming in Scala
ZIO: Powerful and Principled Functional Programming in ScalaZIO: Powerful and Principled Functional Programming in Scala
ZIO: Powerful and Principled Functional Programming in Scala
 
Computer science ms
Computer science msComputer science ms
Computer science ms
 
Elixir formatter Internals
Elixir formatter InternalsElixir formatter Internals
Elixir formatter Internals
 
Rethink programming: a functional approach
Rethink programming: a functional approachRethink programming: a functional approach
Rethink programming: a functional approach
 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 

Excelマクロはじめの一歩

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n