I have two workbooks. I need to apply an if else condition on the 2nd workbook and the output of if else should be saved in the cell of 1st workbook using VBA. my code looks like :
Sub plan()
Dim i As Integer, wb As Workbook
For i = 4 To 100
ActivateWB ("Bhandup Plan 11.xls")
If Workbooks("Bhandup Plan 11.xls").Sheets("Sheet1").Cells(i, 11).Value > 0 _
Or Workbooks("Bhandup Plan 11.xls").Sheets("Sheet1").Cells(i, 12).Value > 0 Then
Workbooks("premium solver.xls").Sheets("AHMD").Cells(i, 1).Value = _
Workbooks("Bhandup Plan 11.xls").Sheets("Sheet1").Cells(i, 2).Value
End If
Next i
End Sub