When I try to call the SetFormula Subroutine, it gives me an error saying Expected: "=". I have no idea why. The routine and the call are below.
SetFormula("=IF(A2=A1,"""",SUMIF(GroupNo, A2,Premium))", "T")
Sub SetFormula(ByVal sCurrCol As String, ByVal sFormula As String) Range(sCurrCol & "2").Select ActiveCell.Formula = sFormula Selection.Copy Range(sCurrCol & "2", sCurrCol & iLower).Select ActiveSheet.Paste Range(sCurrCol & "1", sCurrCol & iLower).Select ColoringEnd Sub
Thanks in advance,cboshdave
I was able to get the subroutine to run by inserting the following to the click event of a command button...
Call SetFormula("=IF(A2=A1,"""",SUMIF(GroupNo, A2,Premium))", "T")
Microsoft is conducting an online survey to understand your opinion of the Msdn Web site. If you choose to participate, the online survey will be presented to you when you leave the Msdn Web site.
Would you like to participate?