Consulting

Results 1 to 2 of 2

Thread: if there is text add conditional format and edges

  1. #1

    if there is text add conditional format and edges

    Hi there

    i cannot figure out how to make this macro

    what my sheet looks like:


    (A1)Navn (B1)Emner TP indeks PPO indeks Index Total Rang
    name1 515 131 94 113 146 1


    i Want a rightedge from A1 to the last name in Column A, but this is variable from sheet to sheet
    Same goes for E and F

    Also i am trying to get a conditional format that makes the column B light green or .Color = -16752384, if the cell is above 300 and also only goes down to last name in column A
    Also same column light red or .Color = 13561798 if below 300
    and columns C:F same problem just with above 99,99 is green and below is red

    I rly hope you can help me =)!

  2. #2
    VBAX Regular
    Joined
    Mar 2013
    Posts
    80
    Location
    This would give you for sure your last name for A (coded not to consider row 1 which is probably headers)

    For i = 2 To 9999999
       If Cells(i, 1) = 0 Then
          EndLine = i - 1
          Exit For
       End If
    next i
    then you loop or range based on endline and do whatever you want. Example for B
    For i = 2 to Endline
    If cells (i,2) > 300 then
       cells (i,2).Interior.Color = 16752384
    else
       cells (i,2).Interior.Color = 13561798
    endif
    next i

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •