Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Userform Stepping Through Sheet Data

Trying to develop a spreadsheet to do pair-wise comparisons and need
some help on the strategy to implement. Have 10 items in a single
column. Want to compare row 1 with 2, 3, 4...., then row 2 with 3, 4,
5..., then 3 with 4, 5, 6..., etc. I put together a userform that gets
the items and allows you to select a radio button to choose between
each fo the two.

I am struggling with the following:

Want the user to keep pressing a next button on the userform after
making their selection. Each press will write the two items on the
sheet, identify which was selected and then go get the next two items
to compare. Not sure how do do this with an On_Click event for the
button. You have to keep track of the first and second comparison
items, but each time you Click the button, the code starts back at the
top of the subroutine. Do you track the items outside the On_Click and
pass parameters? Any help would be appreciated.

Terry

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 857
Default Userform Stepping Through Sheet Data

You can declare form variables to keep/share values across different
methods/events. For example, the code below will count the number of times a
button is clicked. Hopefully this gives you an idea of what you need to do.

Private iClickCount As Integer

Private Sub CommandButton1_Click()
'increment the count
iClickCount = iClickCount + 1
End Sub
Private Sub UserForm_Initialize()
'initialize the variable
iClickCount = 0
End Sub


" wrote:

Trying to develop a spreadsheet to do pair-wise comparisons and need
some help on the strategy to implement. Have 10 items in a single
column. Want to compare row 1 with 2, 3, 4...., then row 2 with 3, 4,
5..., then 3 with 4, 5, 6..., etc. I put together a userform that gets
the items and allows you to select a radio button to choose between
each fo the two.

I am struggling with the following:

Want the user to keep pressing a next button on the userform after
making their selection. Each press will write the two items on the
sheet, identify which was selected and then go get the next two items
to compare. Not sure how do do this with an On_Click event for the
button. You have to keep track of the first and second comparison
items, but each time you Click the button, the code starts back at the
top of the subroutine. Do you track the items outside the On_Click and
pass parameters? Any help would be appreciated.

Terry


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Userform Stepping Through Sheet Data

On Mar 9, 1:43 pm, Vergel Adriano
wrote:
You can declare form variables to keep/share values across different
methods/events. For example, the code below will count the number of times a
button is clicked. Hopefully this gives you an idea of what you need to do.

Private iClickCount As Integer

Private Sub CommandButton1_Click()
'increment the count
iClickCount = iClickCount + 1
End Sub
Private Sub UserForm_Initialize()
'initialize the variable
iClickCount = 0
End Sub



" wrote:
Trying to develop a spreadsheet to do pair-wise comparisons and need
some help on the strategy to implement. Have 10 items in a single
column. Want to compare row 1 with 2, 3, 4...., then row 2 with 3, 4,
5..., then 3 with 4, 5, 6..., etc. I put together a userform that gets
the items and allows you to select a radio button to choose between
each fo the two.


I am struggling with the following:


Want the user to keep pressing a next button on the userform after
making their selection. Each press will write the two items on the
sheet, identify which was selected and then go get the next two items
to compare. Not sure how do do this with an On_Click event for the
button. You have to keep track of the first and second comparison
items, but each time you Click the button, the code starts back at the
top of the subroutine. Do you track the items outside the On_Click and
pass parameters? Any help would be appreciated.


Terry- Hide quoted text -


- Show quoted text -


Thanks. Got it now.

Terry

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
Data on UserForm to different sheet based on day of week chosen? JennLee Excel Programming 3 March 6th 07 04:01 PM
Need assistance to populate sheet from Userform data Corey Excel Programming 2 January 16th 07 03:27 AM
data from userform to a cell on an execel sheet David Marshall Excel Programming 1 February 15th 06 04:07 PM
problem getting data from sheet into txt_boxes in userform Pierre via OfficeKB.com[_2_] Excel Programming 0 October 6th 05 09:32 PM
Userform data to Excel sheet. James Batley Excel Programming 1 September 24th 04 04:48 PM


All times are GMT +1. The time now is 04:18 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"