VBA Excel Programme 1 | How to use Workbook, Worksheets, Sheet
VBA Excel Programme 1
Example 1:-
Sub vbafirst()
' workbook
use for file name describe
Application.Workbooks("vbafirst").Worksheets(2).Range("A1").Value
= "Sheet 2 using"
'worksheet
use for sheet file name/sheet index/position
Worksheets("mysheet1").Range("a1").Value
= "sheet 1 using"
'worksheet
use for sheet file name/sheet index/position
Worksheets(4).Range("a1").Value = "sheet 4
index/position using"
'sheet3
name is vba project sheet name (show in vba code/vba project)
Sheet3.Range("a1").Value = "sheet 3
using"
End Sub