Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi, i got this code very kindly from Tom and i have changed it, but it
does not work. Could you please help me ? Sub TotalsS() ' Dim eRowS As Long Dim fRowS As Long Dim LrowS As Long Dim myValS As Long eRowS = Cells(Rows.Count, 1).End(xlUp).Row fRowS = 4 Do Until LrowS = eRowS + 1 LrowS = Cells(fRowS, 10).End(xlDown).Row + 1 With Cells(LrowS, 10) .Font.Bold = True .HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter .NumberFormat = "R #,##0.00" .FormulaR1C1 = _ "=SUM(R[-" & LrowS - fRowS & "]C:R[-1]C)" With .Borders(xlEdgeTop) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = xlAutomatic End With With .Borders(xlEdgeBottom) .LineStyle = xlDouble .ColorIndex = xlAutomatic End With End With fRowS = LrowS + 2 Loop myValS = Cells(LrowS, 10) With Cells(LrowS, 10) .FormatConditions.Delete .FormatConditions.Add Type:=xlCellValue, Operator:=xlGreater, Formula1:="0" .FormatConditions(1).Interior.ColorIndex = 35 .FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, Formula1:="0" .FormatConditions(2).Interior.ColorIndex = 38 End With If myValS < 0 Then Cells(LrowS, 7) = "Total due to supplier" '--Minus value If myValS 0 Then Cells(LrowS, 7) = "Total due to BMW SA" ' --Positive value With Cells(LrowS, 7) .Font.Bold = True End With Columns("J:J").ColumnWidth = 12 Range("C4").Select ActiveWindow.FreezePanes = True GetSuppNameAS End Sub Les Stout *** Sent via Developersdex http://www.developersdex.com *** |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Code problem | Excel Discussion (Misc queries) | |||
Alt Code Problem | Excel Discussion (Misc queries) | |||
XLS to CSV Code Problem | Excel Worksheet Functions | |||
vba code problem | Excel Programming | |||
Code Problem | Excel Programming |