PMRetired2012
Board Regular
- Joined
- Aug 6, 2019
- Messages
- 123
What i want to do is: I have to employes working and if they work on the same day this code will put entries on 2 diffrent rows and they worked a split shift.
I want it to show that if they worked a split shift on the same day it shows up on one row. The way it is written it shows up on 2 rows.
So what you have now is example 1
date worked: 11-8-2020
Bill worked 3 hrs
sue worked 3 hrs
with example 1 if you enter the data like this it will show up in worksheet as 2 rows ( row 1 will show 11-8-2020 Bill 3 hrs) Sue worked..11-8-2020 Row 2 will show sue worked 3 hrs.
what i want it to show all on row 1 is: Date..11-8-2020..Bill...3 hrs....Sue...3 hrs.
But in the process of this i will be making 2 entries and adding the data one at a time. but when i do that it will show up on 2 rows and not just one row.
This is the code i have now.
Dim lr As Long
Application.ScreenUpdating = True
Sheet = ComboBox5.Text
If Sheet = "" Then
MsgBox "Select Month", vbInformation, "Error"
Exit Sub
End If
Sheets(Sheet).Select
lr = Range("V53").End(xlUp).Row + 1
myName = ComboBox6.Text
iDate = DTPicker3.Value
If myName = "Sandy" Then myCol = "W"
If myName = "Kim" Then myCol = "X"
Range("V" & lr).Value = iDate
Range(myCol & lr).Value = ComboBox10.Value
I want it to show that if they worked a split shift on the same day it shows up on one row. The way it is written it shows up on 2 rows.
So what you have now is example 1
date worked: 11-8-2020
Bill worked 3 hrs
sue worked 3 hrs
with example 1 if you enter the data like this it will show up in worksheet as 2 rows ( row 1 will show 11-8-2020 Bill 3 hrs) Sue worked..11-8-2020 Row 2 will show sue worked 3 hrs.
what i want it to show all on row 1 is: Date..11-8-2020..Bill...3 hrs....Sue...3 hrs.
But in the process of this i will be making 2 entries and adding the data one at a time. but when i do that it will show up on 2 rows and not just one row.
This is the code i have now.
Dim lr As Long
Application.ScreenUpdating = True
Sheet = ComboBox5.Text
If Sheet = "" Then
MsgBox "Select Month", vbInformation, "Error"
Exit Sub
End If
Sheets(Sheet).Select
lr = Range("V53").End(xlUp).Row + 1
myName = ComboBox6.Text
iDate = DTPicker3.Value
If myName = "Sandy" Then myCol = "W"
If myName = "Kim" Then myCol = "X"
Range("V" & lr).Value = iDate
Range(myCol & lr).Value = ComboBox10.Value