It seems that this shouldn't be too hard but I cannot figure it out. I
select a range of cells that may have values or may be blank. I want to
cycle through the cells and give the user a chance to accept the current
value or enter their own. I have a user form with the following code:
Private Sub UserForm_Initialize()
Dim Puzzle As Range
Dim temp As Range
Set Puzzle = Sheets("Puzzle").Range("A1:P16")
For Each temp In Puzzle
'Highlight the cell to show the user where they are
temp.Cells.Interior.ColorIndex = 6
With UserForm2
.StartUpPosition = 0
.Top = 400
.Left = 400
.TextBox1.Text = temp.Value
.TextBox1.SelStart = 0
.TextBox1.SelLength = Len(.TextBox1.Text)
.Show
End With
Next temp
End Sub
Private Sub CommandButton1_Click()
'What to put in here?
End Sub
I had the Range setting code and For loop in the Sheet1 section and I got
the loop to work. It would bring up a form and show the value and I would
cycle through the forms by closing them with the X. Now, I moved this to
the userform as I thought it would need to be there to get a value from the
user to update the cell. How do I cycle through the range and accept or
change values by hitting the Enter button? Also, I want to just use one
form to do this, it seems more sensible.
Is there a better or more acceptable way to do this?
Thanks,
fybar
Bookmarks