LoginSignup
0
1

More than 5 years have passed since last update.

xlwings.Name 簡易リファレンス

Last updated at Posted at 2018-01-23

はじめに

これは xlwings 0.11.5 本家xlwings.Names 本家xlwings.Name の簡易日本語リファレンスである。

xlwings.Names

Names は名前付き範囲名とフィルターを管理する。(テーブルは含まない)
VBA:Names に相当する。

nms = xw.books.active.names                        # アクティブブックの全範囲名管理インスタンスを返す
nms = xw.sheets.active.names                       # アクティブシートの範囲名管理インスタンスを返す

nms['範囲名'] = 'シート名!絶対アドレス'              # 範囲名を登録する
nms['範囲名']                                      # Nameインスタンスを返す
nms('範囲名')                                      # Nameインスタンスを返す
nms(1)                                             # Nameインスタンスを返す
nms.add('範囲名', refers_to='シート名!絶対アドレス') # 新規範囲名を登録する
nms.count                                          # Nameインスタンス数を返す

nms.api                                            # ネイティブインスタンスを返す
範囲名命名規則 範囲
範囲名 ブック単位
シート名!範囲名 シート単位
シート名!_FilterDatabase シート単位

文字ケース区別無しで扱われる

xlwings.Name

Name は単一の範囲名を管理する。
VBA:Name に相当する。

nm.delete()        # 範囲名を削除する
nm.name            # RW 範囲名を返す
nm.refers_to       # RW シート名!絶対アドレス を返す
nm.refers_to_range # xw.Range で返す

nm.api             # ネイティブインスタンスを返す
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1