Posted to microsoft.public.excel.programming
|
|
Number showing row location when you scroll
Hi Garry
You're terrific, it work great.
Thanks a million.
Cimjet
"GS" wrote in message ...
Hi John,
Try this after adding a label named "lblRecordCount"...
Private Sub SpinButton2_Change()
Dim C As Range, rngSource As Range
Dim lPos As Long
Const strFind As String = "*"
With Me.SpinButton2: lPos = (.Max - .Value + 1): End With
Set rngSource = Range("A2:A985")
Me.lblRecordCount.Caption = CStr(lPos) & " of " _
& CStr(rngSource.Rows.Count)
Me.TextBox11.Value = strFind
Set C = rngSource.Cells(lPos, 1).Find(strFind, LookIn:=xlValues)
If Not C Is Nothing Then
Application.ScreenUpdating = False
With Me 'load entry to form
.TextBox1.Value = C.Offset(0, 0).Value
.TextBox2.Value = C.Offset(0, 1).Value
.TextBox3.Value = C.Offset(0, 2).Value
.TextBox4.Value = C.Offset(0, 3).Value
.TextBox5.Value = C.Offset(0, 4).Value
.TextBox6.Value = C.Offset(0, 5).Value
.TextBox7.Value = C.Offset(0, 6).Value
.TextBox8.Value = C.Offset(0, 7).Value
.TextBox9.Value = C.Offset(0, 8).Value
.TextBox10.Value = C.Offset(0, 9).Value
End With
Application.ScreenUpdating = True
End If
End Sub
--
Garry
Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc
|