mrinal saha
Board Regular
- Joined
- Jan 20, 2009
- Messages
- 229
Hi folks,
I am trying to reconcile two xl files and this is written in 3rd excel file called TLM. Break file is already open and after running the macro it will open the Coma holdings file and do the rest. But I am getting Runtime Error 13 and Type mismatch as i approach on the RED line.
Workbooks.Open Filename:="W:\Windows\Desktop\IB OPS\Triparty Existing\Coma Holdings.xls"
Set ch = Workbooks("Coma Holdings.xls")
Set br = Workbooks("Breaks.xls")
Set chs = ch.Sheets("Coma Holdings")
Set brs = br.Sheets("Breaks")
For a = 2 To br.Sheets("Breaks").Cells(Rows.Count, 1).End(xlUp).Row
For b = 2 To ch.Sheets("Coma Holdings").Cells(Rows.Count, 1).End(xlUp).Row
If br.Sheets("Breaks").Cells(a, 12).Value = 0 Then
If br.Sheets("Breaks").Cells(a, 3).Value = ch.Sheets("Coma Holdings").Cells(b, 1).Value Then
If br.Sheets("Breaks").Cells(a, 11).Value = ch.Sheets("Coma Holdings").Cells(b, 11).Value Then
br.Sheets("Breaks").Cells(a, 12).Value = ch.Sheets("Coma Holdings").Cells(b, 17).Value
End If
End If
End If
Next b
Next a
Thanks in advance.
Mrinal
I am trying to reconcile two xl files and this is written in 3rd excel file called TLM. Break file is already open and after running the macro it will open the Coma holdings file and do the rest. But I am getting Runtime Error 13 and Type mismatch as i approach on the RED line.
Workbooks.Open Filename:="W:\Windows\Desktop\IB OPS\Triparty Existing\Coma Holdings.xls"
Set ch = Workbooks("Coma Holdings.xls")
Set br = Workbooks("Breaks.xls")
Set chs = ch.Sheets("Coma Holdings")
Set brs = br.Sheets("Breaks")
For a = 2 To br.Sheets("Breaks").Cells(Rows.Count, 1).End(xlUp).Row
For b = 2 To ch.Sheets("Coma Holdings").Cells(Rows.Count, 1).End(xlUp).Row
If br.Sheets("Breaks").Cells(a, 12).Value = 0 Then
If br.Sheets("Breaks").Cells(a, 3).Value = ch.Sheets("Coma Holdings").Cells(b, 1).Value Then
If br.Sheets("Breaks").Cells(a, 11).Value = ch.Sheets("Coma Holdings").Cells(b, 11).Value Then
br.Sheets("Breaks").Cells(a, 12).Value = ch.Sheets("Coma Holdings").Cells(b, 17).Value
End If
End If
End If
Next b
Next a
Thanks in advance.
Mrinal