Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Bob Bob is offline
external usenet poster
 
Posts: 972
Default 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

Reply
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
row selecting climate Excel Worksheet Functions 3 October 12th 08 05:57 AM
Selecting the Same Steve COR Excel Discussion (Misc queries) 0 January 2nd 08 04:13 PM
Selecting Hutchy Excel Discussion (Misc queries) 3 October 12th 07 11:43 AM
selecting a row srikanth Excel Worksheet Functions 6 July 17th 07 08:44 AM
Selecting every odd row instauratio Excel Discussion (Misc queries) 2 June 15th 05 08:27 PM


All times are GMT +1. The time now is 02:30 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"