Hi Friends,
Can you please review the below code and do let me know where i am lacking.
Column C has the dates and i am trying entering the formula " =IF( OR(RIGHT(C2,3) = " PM",RIGHT(C2,3) = " AM"),A1, CONCATENATE(LEFT(A1,LEN(C2)-2)," ",RIGHT(C2,2))) " to add space between timestamp
6:18PM needs to be come up as 6:18 PM however the highlighted part in RED throws an error ,
also this should be autofill till the last row has the data Column A
Please help
Sub CMS_Avaya()
Dim C As Integer
C = ActiveSheet.Cells.SpecialCells(xlLastCell).Column
Do Until C = 0
If WorksheetFunction.CountA(Columns(C)) = 0 Then
Columns(C).Delete
End If
C = C - 1
Loop
'Insert Columns
Range("E:G").EntireColumn.Insert
'Insert Headers
Range("E1").Value = "Time In"
Range("F1").Value = "Time Out"
Range("G1").Value = "Log In Date"
Worksheets("Sheet4").Range("E1:G1").Font.Bold = True
Worksheets("Sheet4").Range("E2").Formula="=IF( OR(RIGHT(A1,3) = " PM",RIGHT(A1,3) = " AM"),A1, CONCATENATE(LEFT(A1,LEN(A1)-2)," ",RIGHT(A1,2)))"
End Sub
[TABLE="width: 64"]
<tbody>[TR]
[TD="width: 64"][/TD]
[/TR]
</tbody>[/TABLE]
Can you please review the below code and do let me know where i am lacking.
Column C has the dates and i am trying entering the formula " =IF( OR(RIGHT(C2,3) = " PM",RIGHT(C2,3) = " AM"),A1, CONCATENATE(LEFT(A1,LEN(C2)-2)," ",RIGHT(C2,2))) " to add space between timestamp
6:18PM needs to be come up as 6:18 PM however the highlighted part in RED throws an error ,
also this should be autofill till the last row has the data Column A
Please help
Sub CMS_Avaya()
Dim C As Integer
C = ActiveSheet.Cells.SpecialCells(xlLastCell).Column
Do Until C = 0
If WorksheetFunction.CountA(Columns(C)) = 0 Then
Columns(C).Delete
End If
C = C - 1
Loop
'Insert Columns
Range("E:G").EntireColumn.Insert
'Insert Headers
Range("E1").Value = "Time In"
Range("F1").Value = "Time Out"
Range("G1").Value = "Log In Date"
Worksheets("Sheet4").Range("E1:G1").Font.Bold = True
Worksheets("Sheet4").Range("E2").Formula="=IF( OR(RIGHT(A1,3) = " PM",RIGHT(A1,3) = " AM"),A1, CONCATENATE(LEFT(A1,LEN(A1)-2)," ",RIGHT(A1,2)))"
End Sub
[TABLE="width: 64"]
<tbody>[TR]
[TD="width: 64"][/TD]
[/TR]
</tbody>[/TABLE]