LoginSignup
0
1

More than 5 years have passed since last update.

VBAでTitleの列番号を入手する関数を作成する

Posted at

仕事でVBAを操作する機会がたくさんあったのでメモ。

Function Title(WS as Worksheet, TitleName as string)

set WS = WS
Dim TitleRow

TitleRow = 1 'titleの列
For i = 1 to Cells(TitleRow, Columns.Count).End(xlToLeft).Column

if TitleName = cells(TitleRow, i)
exit for
end if

Title = i

end

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