Between values

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am using Excel 97.

I have a workbook which has currently got over 400 worksheets in it, which
is not ideal and does have a tendency to crash periodically.

Each workbook has a unique number

Currently they range for 0024 - 6994

I have split the sheets into separate workbooks say 1-1000, 1001 - 1999 etc
and using an input box I am wanting to select a particular worksheet from one
of these books say for example 3327.

To differentiate between the workbooks I though a select case piece of code
might be useful but I am struggling the correct formula

I assume I need something on the lines of

Case is between 3000 and 4000 then

workbook("3000").activate

Can someone help with a solution, please.

Many thanks
 
Sub Tester1()
Index = Int(Rnd() * 3000 + 1)
Select Case Index
Case 1 To 1000
MsgBox "1 to 1000" & " " & Index
Case 1001 To 2000
MsgBox "1001 to 2000" & " " & Index
Case Else
MsgBox "Above 2000" & " " & Index
End Select
End Sub
 
Mark,

Something like

Select Case myVal
Case 3000 To 4000: Workbooks("3000").Activate
End Select


--

HTH

RP
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top