View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel[_701_] joel[_701_] is offline
external usenet poster
 
Posts: 1
Default Workaround to define an array of constants?


first, I hatte the ON Error statements. I think it bad programming
practive to use an error to find a non-error condition. To test for
sheets I often use a for loop

LastSht = sheets.count
for shtCount = LastSht to 1 step -1
Set Sht = sheets(Shtcount)
If sht.name < "Options" And sht.name < "xPlot" Then
'add your code here
end if
next ShtCount


To get an Array of sheet names use the code below. there isn't a good
way of getting an array of constants.


ShtNames = Array("Sheet1","Sheet3",'Sheet5")
for each ShtName in ShtNames
Set Sht = sheets(ShtNames)

nextt ShtName


--
joel
------------------------------------------------------------------------
joel's Profile: 229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=181370

Microsoft Office Help