+ Reply to Thread
Results 1 to 7 of 7

insert new row at end of sheet in different font

Hybrid View

  1. #1
    Registered User
    Join Date
    06-03-2013
    Location
    brussels
    MS-Off Ver
    Excel 2007
    Posts
    94

    insert new row at end of sheet in different font

    Dear,

    Could someone please help out? My macro should insert a new line with red font for all values to be completed.
    This macro hereunder works already fine but injects a new row in BLACK...

    Could anyone advise?

    Thanks,

    Erik

    ----------------------------

    Sub Add_step()
    Dim ligne
    Dim colonne
    Dim last_ligne
    Dim col_rk
    Dim boucle

    ligne = 13
    col_slct = "C"
    colonne = "A"
    col_rk = "K"

    Cell = Range(colonne & ligne).Value
    While Cell <> ""
    ligne = ligne + 1
    Cell = Range(colonne & ligne).Value
    Wend

    Rows(ligne & ":" & ligne).Select
    Selection.Copy
    Selection.Insert Shift:=xlDown
    Range(colonne & ligne).Value = "=" & colonne & (ligne - 1) & "+1"
    Range(col_rk & ligne).Value = ""
    Range(col_slct & ligne).Select

    Application.CutCopyMode = False

    End Sub

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: insert new row at end of sheet in different font

    Hi rick,

    where in the code you instructed for different font ?
    can you upload a sample workbook along with this code? Thanks.


    Regards,
    DILIPandey
    <click on below * if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), dilipandey@gmail.com

  3. #3
    Registered User
    Join Date
    06-03-2013
    Location
    brussels
    MS-Off Ver
    Excel 2007
    Posts
    94

    Re: insert new row at end of sheet in different font

    Dillipandey,

    I did not yet indicate the font as I am unsure how to include it.
    My aim is that when running the macro a new line should be inserted at the bottom with red font

    Thanks in advance
    Attached Files Attached Files
    Last edited by rickmeister; 07-08-2013 at 08:14 AM.

  4. #4
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: insert new row at end of sheet in different font

    Not sure if you wish to insert a cell or an entire row but use introduce below code:-
    Range(colonne & ligne).Font.ColorIndex = 3
    before
    Range(col_rk & ligne).Value = ""

    Regards,
    DILIPandey
    <click on below * if this helps>

  5. #5
    Registered User
    Join Date
    06-03-2013
    Location
    brussels
    MS-Off Ver
    Excel 2007
    Posts
    94

    Re: insert new row at end of sheet in different font

    thanks! that would be sufficient for me

  6. #6
    Forum Expert Debraj Roy's Avatar
    Join Date
    09-27-2012
    Location
    New Delhi,India
    MS-Off Ver
    Excel 2013
    Posts
    1,469

    Re: insert new row at end of sheet in different font

    Hi Rickmeister!

    Unfortunately.. XLS file will not able to store your "UAT template.xls'!Add_step" macro..

    still a blind shot

    In between these two lines add one more line..

    Range(col_rk & ligne).Value = ""
    Range(col_rk & ligne).Font.Color = vbRed
    Range(col_slct & ligne).Select
    Please let us know.. if you also need to remove BLACK background (if already there)
    Regards!
    =DEC2HEX(3563)

    If you like someone's answer, click the star to give them a reputation point for that answer...

  7. #7
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: insert new row at end of sheet in different font

    Cheers




    Regards,
    DILIPandey
    <click on below * if this helps>

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1