+ Reply to Thread
Results 1 to 8 of 8

change of font colour or background colour vba

  1. #1
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    change of font colour or background colour vba

    Hi all,
    I am using this code to copy data to another sheet.

    I am trying to modify code in a way that when the data is copied to another sheet, the copied row in range A1 the background colour changes to yellow and font colour to Red

    Please Login or Register  to view this content.
    Any help please.

    kind regards

  2. #2
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Re: change of font colour or background colour vba

    Hi all again.
    I have tried many options but still it is not working. Please help
    Kind regards

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: change of font colour or background colour vba

    Hello KK1234,

    You are missing a step in your object reference hierarchy. Both the Color and ColorIndex properties belong to the Interior object.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  4. #4
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Re: change of font colour or background colour vba

    Hi Leith Ross,
    thanks . I was indeed missing a step
    However it still goes to debug and the same line is highlighted
    I dont know why
    I am trying to achieve is that in sheet1, when a row is copied, the column 1 cell gets interior colour yellow
    I have attached a sample now
    Kind regards
    Attached Files Attached Files

  5. #5
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: change of font colour or background colour vba

    Using the activecell here gives the error. Try this:

    Please Login or Register  to view this content.
    Another option:
    Please Login or Register  to view this content.
    Last edited by berlan; 02-22-2014 at 08:01 PM.

  6. #6
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: change of font colour or background colour vba

    Hello KK1234,

    Thanks for posting the workbook. This worked for me.
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Re: change of font colour or background colour vba

    Hi Leith Ross,
    Thanks . This one works fine. I understood the details.

    Also the option 1 given by berlan is the one works great and currently I am going to use it as it exactly does what I was trying to achieve.
    Your solution is also very great and I am going to store it as I will use it at some point in my Learning project ( very big one)

    I have clicked * to thank both of you for your help.
    Kind regards

  8. #8
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Re: change of font colour or background colour vba

    PS: It does not allow me to click star for 'berlan' again as I have just done it in another question.
    Actually 'belron' deserves more *
    Here are from me for 'berlan's great, perfect & prompt help / solution

    Kind regards

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: 09-12-2013, 02:09 PM
  2. Extract Cell Font/Background Colour
    By icu222much in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 07-02-2010, 11:17 PM
  3. Worksheet Background and Font Colour
    By Apple Ling in forum Excel General
    Replies: 9
    Last Post: 06-23-2009, 03:10 AM
  4. [SOLVED] change a cell background colour to my own RGB colour requirements
    By Stephen Doughty in forum Excel General
    Replies: 4
    Last Post: 06-16-2006, 08:15 AM
  5. [SOLVED] change background colour
    By cityfc in forum Excel General
    Replies: 1
    Last Post: 11-11-2005, 09:10 AM

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