LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default SpinButton1.Max not working??

Hi Michael,

Not off the top, but I am intrigued.

Could you send me your workbook so that I could take a look? What version of
Excel? And note my spam filter.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Michael Vaughan" wrote in message
...
Hi Bob,

I replaced your code with what I had and I came up with a "Run-Time Error
'70', Permission Denied". I could not find out for the life of me what
caused that... so I put a "On Error Resume Next" in the Private Sub
UserForm_Initialize() and then it works perfectly!!!!! Outstanding, that

is
exactly how I wanted to work. I guess I have to leave the On Error

message
in, because without it I keep getting the Permission denied??? Any ideas

on
that???

Thanks for you help in this... Michael

Dim County As String
Dim HelpTopic As Integer
Dim aryMax(1 To 4) As Integer

Private Sub CancelButton_Click()
Unload Me
End Sub

Private Sub UpdateForm()
With ComboBox1
County = Left(.Value, InStr(.Value, " ") - 1)
End With
HelpTopic = SpinButton1.Value
LabelAME.Caption = Sheets(County).Cells(HelpTopic, 1)
LabelDoc.Caption = Sheets(County).Cells(HelpTopic, 2)
LabelClass.Caption = Sheets(County).Cells(HelpTopic, 3)
LabelPL.Caption = Sheets(County).Cells(HelpTopic, 4)
LabelPhone.Caption = Sheets(County).Cells(HelpTopic, 5)
LabelAdd.Caption = Sheets(County).Cells(HelpTopic, 6)
LabelNote.Caption = Sheets(County).Cells(HelpTopic, 7)
Me.Caption = "AME's in " & County & " County (Doctor " & HelpTopic

&
"
of " & SpinButton1.Max & ")"
End Sub


Private Sub ComboBox1_Change()
With SpinButton1
.Min = 1
.Max = aryMax(ComboBox1.ListIndex + 1)
.Value = 1
End With

UpdateForm

End Sub

Private Sub SpinButton1_Change()
HelpTopic = SpinButton1.Value
UpdateForm
End Sub

Private Sub Userform_Activate()

With Application.WorksheetFunction
aryMax(1) = .CountA(Sheets("Marion").Range("A:A"))
aryMax(2) = .CountA(Sheets("Hendricks").Range("A:A"))
aryMax(3) = .CountA(Sheets("Hamilton").Range("A:A"))
aryMax(4) = .CountA(Sheets("Hancock").Range("A:A"))
End With

ComboBox1.ListIndex = 0

End Sub

Private Sub UserForm_Initialize()
Me.Caption = APPNAME
With ComboBox1
.AddItem "Marion County"
.AddItem "Hendricks County"
.AddItem "Hamilton County"
.AddItem "Hancock County"
End With
End Sub

--

HTH

Bob Phillips






 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculate working days but change working week SamB Excel Discussion (Misc queries) 1 September 1st 08 09:17 PM
Making weekend days working days - the system cuts the working tim Fluffy Excel Discussion (Misc queries) 1 May 30th 08 10:02 PM
macro was working, now it's not working RichardO[_11_] Excel Programming 2 June 9th 04 06:27 AM
Macro working in Excel 2003; not working in Excel 2000 Leslie Barberie Excel Programming 5 May 20th 04 07:51 PM
Adding sales from a non working day to the previous working day Alex Excel Programming 1 September 19th 03 08:48 AM


All times are GMT +1. The time now is 07:52 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"