Dear Sir,
What you want to achieve really? What is the "Immediate window"? What you want to do with it?
In the immediate window some simple queries can by extracted,
For example,
During Runtime or even during a passive stage we can get
1. The number of sheets in the document.
2. Parent details of the document, [Basically I use this to find out the where the document resides.]
3. Value of variable...like in Watch Window
4. I can even write small bits of code and test if it executes.
5. Make range selection, clear cell values
and many more such commands to the sheet object, without writing a proper Macro.
Private Sub GetSheetNames()
Dim mySht As Worksheet, SRC As Worksheet
Dim i As Integer, r As Integer
r = 6
Set mySht = Sheets("Sheet1")
With mySht
For i = 4 To 14
Set SRC = Sheets(i)
.Cells(r, "a") = SRC.Name
r = r + 1
Next i
End With
End Sub
Anwers to queries appearing in the Immediate Window for the above code
?sheets.Count
14
?r
6
?activesheet.parent.path
D:\Arun\xxxxxx\...gives the path where the doc resides.
?activesheet.name
Master
I am unable to attach the screen shot due to file size restrictions, sorry.
Thank you in advance.
Arun.