Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Margaret Moore   on Feb 25 In MS Office Category.

  
Question Answered By: Sophie Williamson   on Feb 25

Why not just use the name property of the sheet's codename? For
example, the following sets of code give the same result:

n1 = 0
For Each oSheet In Sheets(Array("A", "C"))
n1 = n1 + oSheet.[A1]
Next oSheet
Debug.Print "n1 = " & n1 & vbCrLf

n2 = 0
For Each oSheet In Sheets(Array(Sheet1.Name, Sheet3.Name))
n2 = n2 + oSheet.[A1]
Next oSheet
Debug.Print "n2 = " & n2 & vbCrLf

Share: 

 

This Question has 15 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on How to select specified worksheets by codename Or get search suggestion and latest updates.


Tagged: