Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Save userform values in excel sheet
HI,
I'm new to the userforms. I've created on with a combobox and a textbox. In the same workbook I have a sheet called "Results". When a user clicks "OK" I want the selected values to populate the results worksheet. It works fine with the code below: Worksheets("Results").Range("$B2") = UserForm.ComboBox1.Value Worksheets("Results").Range("$A2") = UserForm.TextBox1.Value However, I want it to go to the next cell each time (B3,B4,B5 etc). Now it's just overwriting the A2 & B2 Valueas. Thanks! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Save userform values in excel sheet
Lastrow = Worksheets("Results").cells(rows.count,"A").end(xl up).Row
Worksheets("Results").Range("$B" & (Lastrow + 1)) = _ UserForm.ComboBox1.Value Worksheets("Results").Range("$A" & (LastRow + 1)) = _ UserForm.TextBox1.Value "Hendrik" wrote: HI, I'm new to the userforms. I've created on with a combobox and a textbox. In the same workbook I have a sheet called "Results". When a user clicks "OK" I want the selected values to populate the results worksheet. It works fine with the code below: Worksheets("Results").Range("$B2") = UserForm.ComboBox1.Value Worksheets("Results").Range("$A2") = UserForm.TextBox1.Value However, I want it to go to the next cell each time (B3,B4,B5 etc). Now it's just overwriting the A2 & B2 Valueas. Thanks! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Save userform values in excel sheet
Joel, apologies for my late reply. This solves my problem perfectly, thanks!
"Joel" wrote: Lastrow = Worksheets("Results").cells(rows.count,"A").end(xl up).Row Worksheets("Results").Range("$B" & (Lastrow + 1)) = _ UserForm.ComboBox1.Value Worksheets("Results").Range("$A" & (LastRow + 1)) = _ UserForm.TextBox1.Value "Hendrik" wrote: HI, I'm new to the userforms. I've created on with a combobox and a textbox. In the same workbook I have a sheet called "Results". When a user clicks "OK" I want the selected values to populate the results worksheet. It works fine with the code below: Worksheets("Results").Range("$B2") = UserForm.ComboBox1.Value Worksheets("Results").Range("$A2") = UserForm.TextBox1.Value However, I want it to go to the next cell each time (B3,B4,B5 etc). Now it's just overwriting the A2 & B2 Valueas. Thanks! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Userform Values into Excel sheet | Excel Programming | |||
Userform Values into Excel sheet | Excel Programming | |||
Insert UserForm Values into Excel sheet | Excel Programming | |||
macro to save a values of a cell in a new sheet as a new row | Excel Programming | |||
Save only values of one sheet | Excel Discussion (Misc queries) |