gundecharahul
New member
- Local time
- Yesterday, 17:49
- Joined
- Jul 30, 2008
- Messages
- 4
Hi,
I have written following VBA code in excel which i need to write in access.
Sub Macro3()
i = 2
Do While (Cells(i, 1) <> "")
If (Cells(i, 1) = "CONU_TEMP.xls" And Cells(i + 1, 1) = "CONU_EIM.xls") Then
Range("b" & i).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=B" & i & "<>B" & i + 1 & ""
Selection.FormatConditions(1).Interior.ColorIndex = 3
Range("b" & i).Select
Selection.AutoFill Destination:=Range(Selection, Selection.End(xlToRight)), Type:=xlFillFormats
Range("b" & i + 1).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=B" & i & "<>B" & i + 1 & ""
Selection.FormatConditions(1).Interior.ColorIndex = 3
Range("b" & i).Select
Selection.AutoFill Destination:=Range(Selection, Selection.End(xlToRight)), Type:=xlFillFormats
i = i + 1
Else: i = i + 1
End If
Loop
End Sub
I tried lot but was not able to translate the code of excel into Access.
I would really appreciate if someone could help me in this.
Thanks in advance..
Rahul
I have written following VBA code in excel which i need to write in access.
Sub Macro3()
i = 2
Do While (Cells(i, 1) <> "")
If (Cells(i, 1) = "CONU_TEMP.xls" And Cells(i + 1, 1) = "CONU_EIM.xls") Then
Range("b" & i).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=B" & i & "<>B" & i + 1 & ""
Selection.FormatConditions(1).Interior.ColorIndex = 3
Range("b" & i).Select
Selection.AutoFill Destination:=Range(Selection, Selection.End(xlToRight)), Type:=xlFillFormats
Range("b" & i + 1).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=B" & i & "<>B" & i + 1 & ""
Selection.FormatConditions(1).Interior.ColorIndex = 3
Range("b" & i).Select
Selection.AutoFill Destination:=Range(Selection, Selection.End(xlToRight)), Type:=xlFillFormats
i = i + 1
Else: i = i + 1
End If
Loop
End Sub
I tried lot but was not able to translate the code of excel into Access.
I would really appreciate if someone could help me in this.
Thanks in advance..
Rahul