LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Specifying activesheets to multiple buttons....possible?

Hi,

I am working with a multiple page userform. On page one, I have th
following command buttons:

Enter (sheet 1)
Enter (sheet 2)

The first button inputs information into sheet 1 and the 2nd butto
"enter sheet 2" inputs information onto sheet 2.

On page two of the multiple page userform, I have the followin
buttons:

Update
Next Record
Previous Record

question: Is there a way to specify that only "next record" an
"Previous record" buttons only work with Sheet 2? When I started usin
the multipage form, and used the 2nd multpage buttons and not realizin
that sheet 1 was being displayed in the textboxes. This sound
strange. But when sheet 1 is up and running, and I am using th
multipage 2 buttons, sheet 1 information is appearing...I really don'
want that to happen.

Here's the coding for the Next and Previous buttons:

Private Sub CommandButton5_Click() [for the next button]

Dim lastRow As Long
If ActiveCell.Column < 1 Then
Cells(ActiveCell.Row, 1).Select
End If
If ActiveCell.Row < lastRow Then
ActiveCell.Offset(1, 0).Select
TextBox18.Text = ActiveCell.Value
TextBox19.Text = ActiveCell.Offset(0, 1).Value
TextBox20.Text = ActiveCell.Offset(0, 2).Value
TextBox21.Text = ActiveCell.Offset(0, 3).Value
TextBox22.Text = ActiveCell.Offset(0, 4).Value
TextBox23.Text = ActiveCell.Offset(0, 5).Value
TextBox24.Text = ActiveCell.Offset(0, 6).Value
TextBox25.Text = ActiveCell.Offset(0, 7).Value
TextBox26.Text = ActiveCell.Offset(0, 8).Value
TextBox27.Text = ActiveCell.Offset(0, 9).Value
End If
End Sub



Private Sub CommandButton6_Click() [for the previous button]
If ActiveCell.Column < 1 Then
Cells(ActiveCell.Row, 1).Select
End If
If ActiveCell.Row < 1 Then
ActiveCell.Offset(-1, 0).Select
TextBox18.Text = ActiveCell.Value
TextBox19.Text = ActiveCell.Offset(0, 1).Value
TextBox20.Text = ActiveCell.Offset(0, 2).Value
TextBox21.Text = ActiveCell.Offset(0, 3).Value
TextBox22.Text = ActiveCell.Offset(0, 4).Value
TextBox23.Text = ActiveCell.Offset(0, 5).Value
TextBox24.Text = ActiveCell.Offset(0, 6).Value
TextBox25.Text = ActiveCell.Offset(0, 7).Value
TextBox26.Text = ActiveCell.Offset(0, 8).Value
TextBox27.Text = ActiveCell.Offset(0, 9).Value
End If
End Sub



Any and all help is appreciated.

thanks,

marty

--
Message posted from http://www.ExcelForum.com

 
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
buttons bleeding onto multiple pages uncdubya Setting up and Configuration of Excel 0 April 20th 10 06:47 PM
enable/disable multiple buttons Shoney Excel Discussion (Misc queries) 1 January 11th 08 02:41 AM
renaming multiple buttons GreenBean Excel Discussion (Misc queries) 2 July 21st 06 09:42 PM
Deleting multiple Macro buttons Ant Excel Discussion (Misc queries) 3 June 13th 06 02:34 AM
Multiple fill color buttons susielotus Excel Discussion (Misc queries) 1 February 5th 06 03:04 PM


All times are GMT +1. The time now is 07:28 AM.

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"