ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Form Input--Submit (https://www.excelbanter.com/excel-programming/331476-form-input-submit.html)

evangray123

Form Input--Submit
 

Hello,

Does any one know how I can take the info from an excel form I created
and have it inputted into a seperate tab in the same file i
alphabetical order.

thanks
eva

--
evangray12
-----------------------------------------------------------------------
evangray123's Profile: http://www.excelforum.com/member.php...fo&userid=1742
View this thread: http://www.excelforum.com/showthread.php?threadid=37816


Dave Peterson[_5_]

Form Input--Submit
 
Debra Dalgleish has a small getstarted with userforms tutorial at:
http://www.contextures.com/xlUserForm01.html

And after you finish populating the worksheet, you could just sort your data.

If you need to do it in code, record a macro the first time you do it and add
that to your existing macro.

evangray123 wrote:

Hello,

Does any one know how I can take the info from an excel form I created,
and have it inputted into a seperate tab in the same file in
alphabetical order.

thanks
evan

--
evangray123
------------------------------------------------------------------------
evangray123's Profile: http://www.excelforum.com/member.php...o&userid=17429
View this thread: http://www.excelforum.com/showthread...hreadid=378164


--

Dave Peterson

evangray123[_2_]

Form Input--Submit
 

Thanks for the tip......

Maybe you can tell me why I am having trouble getting the data from my
multiple selection listbox in my form, to the spreadsheet. It doesnt
seem to be transferring any of the info, and I am having some trouble
figuring it out. If the user selects multiple items, it should transfer
to the spreadsheet with each selection listed and seperated by a comma.

Thanks


--
evangray123
------------------------------------------------------------------------
evangray123's Profile: http://www.excelforum.com/member.php...o&userid=17429
View this thread: http://www.excelforum.com/showthread...hreadid=378164


Dave Peterson[_5_]

Form Input--Submit
 
Something like this worked ok for me:

Option Explicit
Private Sub CommandButton1_Click()

Dim iCtr As Long
Dim oRow As Long
Dim wks As Worksheet

Set wks = Worksheets("sheet2")

oRow = 1
With Me.ListBox1
For iCtr = 0 To .ListCount - 1
If .Selected(iCtr) Then
wks.Cells(oRow, "A").Value = .List(iCtr)
oRow = oRow + 1
End If
Next iCtr
End With

Unload Me

End Sub

Private Sub UserForm_Initialize()
Dim iCtr As Long

With Me.ListBox1
.MultiSelect = fmMultiSelectMulti
For iCtr = 1 To 10
.AddItem "asdf" & iCtr
Next iCtr
End With

End Sub

You'll want to loop through all the items in that listbox (0 to .listcount -1)
to see if it's selected.


evangray123 wrote:

Thanks for the tip......

Maybe you can tell me why I am having trouble getting the data from my
multiple selection listbox in my form, to the spreadsheet. It doesnt
seem to be transferring any of the info, and I am having some trouble
figuring it out. If the user selects multiple items, it should transfer
to the spreadsheet with each selection listed and seperated by a comma.

Thanks

--
evangray123
------------------------------------------------------------------------
evangray123's Profile: http://www.excelforum.com/member.php...o&userid=17429
View this thread: http://www.excelforum.com/showthread...hreadid=378164


--

Dave Peterson


All times are GMT +1. The time now is 11:30 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com