next cell
Maybe you can do something with this:
Option Explicit
Sub testme()
Dim FCell As Range
Dim destCell As Range
With ActiveSheet.Columns(1)
Set FCell = .Find(what:="31", after:=.Cells(1), _
LookIn:=xlValues, lookat:=xlWhole, _
searchdirection:=xlPrevious, _
MatchCase:=False, searchorder:=xlByRows)
End With
If FCell Is Nothing Then
MsgBox "not found"
Else
If IsEmpty(FCell.Offset(1, 0)) Then
Set destCell = FCell.Offset(1, 0)
Else
Set destCell = FCell.End(xlDown).Offset(1, 0)
End If
'do what you want to destcell
destCell.Value = "whatever"
End If
End Sub
David W wrote:
Got a little problem, got this one pieced together with 1 glitch
It does what it says, but I need it to go to the last number in that
search(the way the sheet is laid out is when there is a entry, it puts the
index number from the combobox each time, anotherwords (lets use 31 as the
combobox's selected value) if you have got 12 entries, there will be 12
"31's" "in column A", I need to go to the next empty cell after the last
"31" and insert the values from the boxes being used in this form.
Keep in mind that this maybe in the middle of the sheet between existing
records where there will be other numbers in the same column but, not the
same number(the column start from the smallest to the biggest top to bottom
Private Sub CommandButton2_Click()
Dim Fcell As Range
Set Fcell = Columns(1).Find(ComboBox1, lookat:=xlWhole)
If Fcell = ComboBox1.value Then
Sheets("kenjan").Unprotect ("?")
Fcell.Select
ActiveCell.Next.Select
ActiveCell.Offset(1, 0) = ComboBox1.value
ActiveCell.Offset(1, 3) = TextBox1.value
ActiveCell.Offset(1, 5) = TextBox1.value
ActiveCell.Offset(1, 7) = TextBox1.value
ActiveCell.Offset(1, 9) = Val(Me.TextBox3.value) - Val(Me.TextBox2.value)
TextBox1.value = ""
TextBox2.value = ""
TextBox3.value = ""
End If
End Sub
--
Dave Peterson
|