VBA Code for entering items on same row with 2 or more entries and on same date

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
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

Forum statistics

Threads
1,215,527
Messages
6,125,334
Members
449,218
Latest member
Excel Master

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top