View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Patrick Molloy[_2_] Patrick Molloy[_2_] is offline
external usenet poster
 
Posts: 1,298
Default Why Sheet1 is displayed in modules as sheet1

you can change this in the properties window
The (name) property, with the word 'name' in parentheses is the sheet
object name....eg change sheet1 to shMain.
You can use this in VBA code
shMain.Range("A1") = "Main Sheet"

The Name property - ie without the parentheses, is the name that appears on
the
sheet tab, and is the reference used in the Worksheets() collection
So for shMain set the Name property to 'Main'
Now these two code blocks are equivalent:

With shMain
.Range("A1") = "Using the object"
End With
With Worksheets("Main")
.Range("A2")="Using the indirect"
End With

HTH

"Jim at Eagle" wrote:

all other sheets are Sheets?
--
Jim at Eagle