Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Data on UserForm to different sheet based on day of week chosen? | Excel Programming | |||
Need assistance to populate sheet from Userform data | Excel Programming | |||
data from userform to a cell on an execel sheet | Excel Programming | |||
problem getting data from sheet into txt_boxes in userform | Excel Programming | |||
Userform data to Excel sheet. | Excel Programming |