1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

VBAそのままコピペ「ブックシートの選択」

Last updated at Posted at 2019-07-26
ブックシートの検索

Workbooks("Book1.xls").Worksheets("Sheet1").Range("A1:B10")= "文字"

.value

ブック、シートまたぎの時は2
Workbooks("Book2.xlsx").Activate
Sheets("Sheet2").Select

コピペ用
Sub Sample()
 
ActiveWorkbook.ActiveSheet.Range("A1").Value = "ActiveWorkbook"
'【選択されているBook】の【選択されているSheet】
 
ThisWorkbook.Worksheets("Sheet1").Range("A2").Value = "ThisWorkbook"
'【マクロの書かれているBook】のSheet1
 
Workbooks(1).Worksheets(1).Range("A3").Value = "Workbooks(1)"
'【最初に開いたBook】の【一番左のSheet】
 
End Sub
1
0
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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?