Note that there are some explanatory texts on larger screens.

plurals
  1. POCodehelp: Seeking column, and format cells
    primarykey
    data
    text
    <p>I have a little problem with my macrocode, and need your advice. Here my base macrocode:</p> <pre><code>Option Explicit Sub NurZumUeben() 'oberste Zeile löschen, fixieren und linksbündig ausrichten Rows("1:1").Select Selection.Delete Shift:=xlUp With ActiveWindow .SplitColumn = 0 .SplitRow = 1 End With ActiveWindow.FreezePanes = True 'Jede zweite Zeile schattieren Application.ScreenUpdating = False Dim Zeile, ZeilenNr As Integer With ActiveSheet.UsedRange.Rows .Interior.ColorIndex = xlNone .Borders.ColorIndex = xlNone End With ZeilenNr = 2 For Zeile = 2 To ActiveSheet.UsedRange.Rows.Count With Rows(Zeile) If .Hidden = False Then If ZeilenNr Mod 2 = 0 Then .Interior.ColorIndex = 15 .Borders.Weight = xlThin .Borders.ColorIndex = 16 ZeilenNr = ZeilenNr + 1 Else ZeilenNr = ZeilenNr + 1 End If End If End With Next Zeile Application.ScreenUpdating = True 'oberste Zeile einfärben Rows("1:1").Select With Selection.Interior .Pattern = xlSolid .PatternColorIndex = xlAutomatic .Color = 65535 .TintAndShade = 0 .PatternTintAndShade = 0 End With 'Spalte_suchen&amp;formatieren Dim iLeSpa As Integer Dim iSpalte As Integer Dim bGefunden As Boolean iLeSpa = IIf(IsEmpty(Cells(1, Columns.Count)), Cells(1, _ Columns.Count).End(xlToLeft).Column, Columns.Count) For iSpalte = 1 To iLeSpa If Cells(1, iSpalte).Value = "click_thru_pct" Then bGefunden = True Exit For End If Next iSpalte If bGefunden Then With Range(Cells(2, iSpalte), Cells(5000, iSpalte)) .Replace What:="%", Replacement:="", LookAt:=xlPart, SearchOrder:=xlByRows Range("K1") = 100 Range("K1").Copy .PasteSpecial Paste:=xlPasteAll, Operation:=xlDivide .NumberFormat = "0.00%" Range("K1").Clear End With Else MsgBox "Die Überschrift ""click_thru_pct"" wurde nicht gefunden.", _ 48, " Hinweis für " &amp; Application.UserName End If End Sub </code></pre> <p>Once thank you all who can help. Unfortunately, I get the final formatting not go quite</p> <p>Here are the results: <a href="http://www.civelek.com/space-anomaly.com/excel.PNG" rel="nofollow">example</a></p> <p>I did not want to color the entire column but only the top row. In addition, the lower empty fields with ugly 0.00% formatted constantly.</p> <p>Furthermore, I noticed that after the coloration of the first line, the field K1 is visible. That is with me unfortunately impractical because these Excel documents can also go differently in the row.</p> <p>Here is the document on which you can test it if necessary. <a href="http://www.civelek.com/space-anomaly.com/report.xlsb" rel="nofollow">example</a></p> <p>Thank you very much</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload