Richard_mcr
New Member
- Joined
- Oct 19, 2023
- Messages
- 8
- Office Version
- 2019
- Platform
- Windows
Hello All,
I'm a little stuck on some code and would appreciate some pointers please?
Basically, I'm using a user form to input task details. The tasks are assigned to individuals and the inputs go to a 'HandleData' worksheet. This all works great, however I would like to revise the method and have the input data save to a different worksheet based on a user form combo box value. The user form combo box is - cbo.***
I feel it should be simple, however cannot find the solution myself, or online...
Here's what I have so far that works, and below it my closest guess that returns an error:
*******************************************************************************************************************************************************************
'Save task and close button
Private Sub cmdAddClose_Click()
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("HandleData")
'Find first empty row in "HandleData" database using column 1
iRow = Worksheets("HandleData").Columns(1).Cells.Find(what:="*", SearchOrder:=xlRows, SearchDirection:=xlPrevious, LookIn:=xlValues).Row + 1
*******************************************************************************************************************************************************************
'Save task and close button
Private Sub cmdAddClose_Click()
Dim iRow As Long
Dim ws As Worksheet
Set ws = Me.cboAss.Value
'Find first empty row in "HandleData" database using column 1
iRow = Worksheets("HandleData").Columns(1).Cells.Find(what:="*", SearchOrder:=xlRows, SearchDirection:=xlPrevious, LookIn:=xlValues).Row + 1
*******************************************************************************************************************************************************************
Thanks in advance!!
I'm a little stuck on some code and would appreciate some pointers please?
Basically, I'm using a user form to input task details. The tasks are assigned to individuals and the inputs go to a 'HandleData' worksheet. This all works great, however I would like to revise the method and have the input data save to a different worksheet based on a user form combo box value. The user form combo box is - cbo.***
I feel it should be simple, however cannot find the solution myself, or online...
Here's what I have so far that works, and below it my closest guess that returns an error:
*******************************************************************************************************************************************************************
'Save task and close button
Private Sub cmdAddClose_Click()
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("HandleData")
'Find first empty row in "HandleData" database using column 1
iRow = Worksheets("HandleData").Columns(1).Cells.Find(what:="*", SearchOrder:=xlRows, SearchDirection:=xlPrevious, LookIn:=xlValues).Row + 1
*******************************************************************************************************************************************************************
'Save task and close button
Private Sub cmdAddClose_Click()
Dim iRow As Long
Dim ws As Worksheet
Set ws = Me.cboAss.Value
'Find first empty row in "HandleData" database using column 1
iRow = Worksheets("HandleData").Columns(1).Cells.Find(what:="*", SearchOrder:=xlRows, SearchDirection:=xlPrevious, LookIn:=xlValues).Row + 1
*******************************************************************************************************************************************************************
Thanks in advance!!