Capture.JPGHello Friend I am trying to create a Macro where while tesiting i am getting the below compile Error.
Column B is Employee Name
Column E is the Project Details (A, B, C, D)
Column G, H, I, J, K Are the expense (Airport Tax, Hotel , Fare, Other)
I wanted to copy these details in the Sheets Name based on Projects (A, B, C, D)
I have attached the IMAGE
Below is the Macro
Sub traveldtls()
Dim ws As Worksheet
Dim lastrow As Long
Dim i As Integer
Dim expdtls1 As Integer
Dim expdtls2 As Integer
Dim EMPname As String
lastrow = ActiveSheet.Range("B" & Rows.Count).End(xlUp).Row
For i = 2 To lastrow
If Cells(i, 5) = "A" Then
Range(Cells(i, 2), Cells(i, 6), Cells(i, 7)).Select
Sheets(2).Range(Cells(4, 6), Cells(4, 7), Cells(4, 7)).PasteSpecial
End If
Next i
End Sub
Bookmarks