Sheets("Sheet1").Select
Sheets("Sheet2").Cells(2, 5).Value = 100
Sub One() Dim shTrklon As Worksheet Set shTrklon = Worksheets(2) shTrklon.Select shTrklon.Cells(2, 5).Value = 100 End Sub
Quote:(...)This error has the following causes and solutions: You referenced a nonexistent array element.You declared an array but didn't specify the number of elements.You referenced a nonexistent collection member.You used a shorthand form of subscript that implicitly specified an invalid element.
Worksheets(2).Range("A1") = "Stupid code"
ThisWorkbook.Worksheets(2).Range("A1") = "Excellent code!"
Dim wsh = ThisWorkbook.Worksheets("Sheet1")
Worksheets(2)
Sheet1
Sheet2
Sheet3
Select
Sheet_Change
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)