ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Selecting the next row up or down?????? (https://www.excelbanter.com/excel-discussion-misc-queries/227164-selecting-next-row-up-down.html)

Bob

Selecting the next row up or down??????
 
I have a userform with several textboxes which I fill in data and save to a
data sheet. It also has a search facility by inserting a date in textbox1 and
pressing a commandbutton, it brings up data from that row.
I am trying to find a way to select the next row up or down and have the
data display. So that I can select a date and have the data displayed then go
up or down the rows from that date.
--
Bob

Gary''s Student

Selecting the next row up or down??????
 
To select the next row down from where you a

Sub OneRowDown()
ActiveCell.Offset(1, 0).EntireRow.Select
End Sub
--
Gary''s Student - gsnu200845


"Bob" wrote:

I have a userform with several textboxes which I fill in data and save to a
data sheet. It also has a search facility by inserting a date in textbox1 and
pressing a commandbutton, it brings up data from that row.
I am trying to find a way to select the next row up or down and have the
data display. So that I can select a date and have the data displayed then go
up or down the rows from that date.
--
Bob


Daniel.C[_3_]

Selecting the next row up or down??????
 
Have a look at the following file. It uses a spinbutton to move up and
down :
http://www.filedropper.com/bob
HTH
Daniel

I have a userform with several textboxes which I fill in data and save to a
data sheet. It also has a search facility by inserting a date in textbox1 and
pressing a commandbutton, it brings up data from that row.
I am trying to find a way to select the next row up or down and have the
data display. So that I can select a date and have the data displayed then go
up or down the rows from that date.




Bob

Selecting the next row up or down??????
 
Thanks Gary that works but I need it to select the data on that row from
sheet2.
I have the following code so far (without your code in). The data is found
on sheet2

Private Sub CommandButton4_Click()
Dim FoundCell As Range

ActiveCell.Offset(-1, 0).Select

If FoundCell Is Nothing Then
'this shouldn't happen!
Beep
Else
Me.TextBox1.Value = FoundCell.Offset(0, 1).Value
Me.ComboBox1.Value = FoundCell.Offset(0, 1).Value
Me.TextBox2.Value = FoundCell.Offset(0, 2).Value

If IsDate(FoundCell.Offset(0, 0).Value) Then
Me.TextBox1.Value = Format(FoundCell.Offset(0, 0).Value, "dd-mmm-yy")
Else
Me.TextBox1.Value = ""
Me.TextBox2.Value = ""
End If
End If
End Sub

any ideas?
--
Bob


"Gary''s Student" wrote:

To select the next row down from where you a

Sub OneRowDown()
ActiveCell.Offset(1, 0).EntireRow.Select
End Sub
--
Gary''s Student - gsnu200845


"Bob" wrote:

I have a userform with several textboxes which I fill in data and save to a
data sheet. It also has a search facility by inserting a date in textbox1 and
pressing a commandbutton, it brings up data from that row.
I am trying to find a way to select the next row up or down and have the
data display. So that I can select a date and have the data displayed then go
up or down the rows from that date.
--
Bob



All times are GMT +1. The time now is 12:34 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com