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: 31
Default Edit current row in user form

Thanks John That will be very useful

"john" wrote:

small update to Lock textboxes programatically

Private Sub ScrollBar1_Change()

Dim myrow As Long
Dim i As Integer

myrow = Me.ScrollBar1.Value

'textboxes
For i = 1 To 22

Select Case i

Case Is = 6, 7

With Me.Controls("TextBox" & i)

.Text = "P"

.Locked = True

End With

Case Is = 14, 18

With Me.Controls("TextBox" & i)

.Text = "C"

.Locked = True

End With

Case Else

With Me.Controls("TextBox" & i)

.Text = Dataws.Cells(myrow, i).Value

.Locked = False

End With

End Select

Next


End Sub
--
jb


"john" wrote:

set the textbox properties to LOCKED for those you don't want users to edit.

Then replace scrollbar code with this version. You will need to adjust the
Case = code to the appropriate textbox number.

Private Sub ScrollBar1_Change()

Dim myrow As Long
Dim i As Integer

myrow = Me.ScrollBar1.Value

'textboxes
For i = 1 To 22

Select Case i

Case Is = 6, 7

Me.Controls("TextBox" & i).Text = "P"

Case Is = 14, 18

Me.Controls("TextBox" & i).Text = "C"

Case Else

Me.Controls("TextBox" & i).Text = _
Dataws.Cells(myrow, i).Value

End Select

Next


End Sub
--
jb


"ajm1949" wrote:

Thanks John
It all seems to work well
Just one more question
I need to restrict data input in some cells to a "P" or a "C"
Any suggestions?
Cheers
Alan


"ajm1949" wrote:

I have 2 questions
1.How can I display the selected row (22 columns) in a user form so the data
can be edited and then saved into the current row?
2.How can I scroll through the rows using a form? (Next and back buttons?)
I already have the form created to enter the data-no problems there. Just
not sure how to add the current row into a form

Many Thanks in advance

ajm1949

 
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
Edit cells with user form open Miree Excel Programming 2 October 30th 08 11:00 AM
Get current cell after OK on user form? Gustaf Excel Programming 2 April 13th 08 08:01 PM
User form - Get record & Edit Data Matts Excel Programming 0 November 19th 07 04:00 PM
Edit worksheet while a user form is on? Huyeote Excel Programming 0 September 12th 03 04:05 AM


All times are GMT +1. The time now is 06:58 PM.

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"