Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I´ve worked up this code so far:
Sub PrintFormat() Dim ws As Worksheet Dim prt1 As String Dim prt2 As String Dim StrArray() As String prt1 = "" For Each ws In Worksheets If InStr(1, ws.Name, "F") 1 Then prt1 = prt1 & ", " & """" & ws.Name & """" End If Next ws prt1 = Mid(prt1, 3, Len(prt1)) prt2 = Mid(prt1, 2, Len(prt1) - 2) 'Worksheets("ark3").Range("A1") = prt '"O-002F","O-003F" Sheets(Array("O-002F", "O-003F")).Select 'this one works Sheets(Array((prt1))).Select 'this one doesnt work Sheets(Array(("&prt2"))).Select 'this one doesnt work End Sub While debugging it says "Subscript out of range" on either of th arrays that are done over the variables prt1 and prt2, but holding th cursor over the variables they seem to be strings with the same conten as is in the first array. The problem is that over time a lot mor sheets will be added, and all sheets containging the letter f must b in the array. I am sorry if my english is bad ; -- Message posted from http://www.ExcelForum.com |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
countif with variabel criteria? | Excel Worksheet Functions | |||
Make formula more simple --- array? | Excel Discussion (Misc queries) | |||
Can I make array position A(12) into a variable A(12*n) ? | Excel Worksheet Functions | |||
getting the sum of variabel ranges | Excel Worksheet Functions | |||
The # in my vector is absent from my array. Can I make it 0? | Excel Worksheet Functions |