10. august 2005 - 11:04
Der er
1 kommentar og 1 løsning
Makro med understreg og fed skrift
Jeg har nedenstående makro... Nu ønsker jeg at få sat Fed skrift og understræg på hvert felt hvor sum formlen er brugt... Hvordan gør jeg det ? Old = "Start" Line1 = False StartSumRække = 2 For Each c In Range("A2:A999") If (Not Old = c.Value And Old <> "Start") Or Line1 Then c.EntireRow.Insert Shift:=xlDown If Line1 Then Cells(c.Row - 2, 4).Formula = "=SUM(d" & StartSumRække & ":d" & c.Row - 3 & ")" Cells(c.Row - 2, 5).Formula = "=SUM(d" & StartSumRække & ":d" & c.Row - 3 & ")*110" Cells(c.Row - 2, 6).Formula = "=SUM(f" & StartSumRække & ":f" & c.Row - 3 & ")" Cells(c.Row - 2, 7).Formula = "=SUM(f" & StartSumRække & ":f" & c.Row - 3 & ")*3.12" Cells(c.Row - 2, 9).Formula = "=SUM(i" & StartSumRække & ":i" & c.Row - 3 & ")" Cells(c.Row - 2, 10).Formula = "=SUM(j" & StartSumRække & ":j" & c.Row - 3 & ")" StartSumRække = c.Row Line1 = False Else Line1 = True End If End If Old = c.Value Next c
Annonceindlæg fra Infor
10. august 2005 - 11:11
#1
Prøv med Old = "Start" Line1 = False StartSumRække = 2 For Each c In Range("A2:A999") If (Not Old = c.Value And Old <> "Start") Or Line1 Then c.EntireRow.Insert Shift:=xlDown If Line1 Then Cells(c.Row - 2, 4).Formula = "=SUM(d" & StartSumRække & ":d" & c.Row - 3 & ")" Cells(c.Row - 2, 5).Formula = "=SUM(d" & StartSumRække & ":d" & c.Row - 3 & ")*110" Cells(c.Row - 2, 6).Formula = "=SUM(f" & StartSumRække & ":f" & c.Row - 3 & ")" Cells(c.Row - 2, 7).Formula = "=SUM(f" & StartSumRække & ":f" & c.Row - 3 & ")*3.12" Cells(c.Row - 2, 9).Formula = "=SUM(i" & StartSumRække & ":i" & c.Row - 3 & ")" Cells(c.Row - 2, 10).Formula = "=SUM(j" & StartSumRække & ":j" & c.Row - 3 & ")" For i = 4 To 7 Cells(c.Row - 2, i).Font.Bold = True Cells(c.Row - 2, i).Font.Underline = xlUnderlineStyleSingle Next i For i = 9 To 10 Cells(c.Row - 2, i).Font.Bold = True Cells(c.Row - 2, i).Font.Underline = xlUnderlineStyleSingle Next i StartSumRække = c.Row Line1 = False Else Line1 = True End If End If Old = c.Value Next c