Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Thanks Jim.
I was pretty close to the solution, heading on the right lines of cycling and saving the names but didn't know the "objShts" stuff to make it work. A few tweaks to bypass the tab indexes and sorted. Cheers Giz "Jim Cone" wrote: Sub JustTheOnesIWant() 'Selects all sheets between two designated sheets. 'Jim Cone - San Francisco, USA - May 2006 Dim objShts As Excel.Sheets Dim varArry As Variant Dim lngStart As Long Dim lngEnd As Long Dim N As Long lngStart = Worksheets("SheetStart").Index lngEnd = Worksheets("SheetFinish").Index If lngEnd < lngStart Then MsgBox "Please reorder sheets. " Exit Sub End If ReDim varArry(lngStart To lngEnd) For N = lngStart To lngEnd varArry(N) = Worksheets(N).Name Next Set objShts = Sheets(varArry) objShts.Select Set objShts = Nothing End Sub ------------ Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware "Gizmo63" wrote in message Hi folks, Is there a way of selecting a variable number of worksheets in VB so that I can apply a simultaneous fix. I can't do the sheets 1 at a time as the fix includes inserting some columns and the references will go screwy. It is possible to do manually so should be possible in VB. The equivalent of holding the control key and clicking on the tabs you want. I would be looking at 'selecting' all the tabs between "START" and "END" (these will have user defined names so cannot be specified in the macro) and then 2 additional pre-defined tabs. Any ideas anyone? Giz |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
selecting multiple sheet tabs and open another workbook | Excel Discussion (Misc queries) | |||
Autofilter Lists across Multiple Sheets, Maintain Correct Referenc | Excel Worksheet Functions | |||
Select Multiple sheets | Excel Discussion (Misc queries) | |||
Calculations crossing multiple sheets | Excel Discussion (Misc queries) | |||
linking multiple sheets to a summary sheet | Excel Discussion (Misc queries) |