+ Reply to Thread
Results 1 to 7 of 7

the colours to be changed when rows are added or deleted

  1. #1
    Registered User
    Join Date
    03-26-2008
    Posts
    3

    the colours to be changed when rows are added or deleted

    I am a branch manager of a mortgage company. I created a spreadsheet to better track the clients for my branch between myself and my processor. I created a spreadsheet that is 12 columns wide and 34 long. I have chosen 5 colors that I alternate each row and repeat the colors throughout the 34 rows. My question is this, say that the client that is listed on row 5 closes, I want to be able to delete the data in that row and have the 6th row become the 5th and so forth. Hopefully this can work the other way as well so if I wanted to insert a row. My wife seems to think it can;t be done. My neighbor on the other hand (who is typically right) thinks this can be accomplished.

    Any help is greatly appreciated.

    Thanks
    Kris

  2. #2
    Valued Forum Contributor ratcat's Avatar
    Join Date
    03-07-2008
    Location
    Rural NSW, Australia
    MS-Off Ver
    Vista 2007
    Posts
    1,111
    Quote Originally Posted by mtgman
    I am a branch manager of a mortgage company. I created a spreadsheet to better track the clients for my branch between myself and my processor. I created a spreadsheet that is 12 columns wide and 34 long. I have chosen 5 colors that I alternate each row and repeat the colors throughout the 34 rows. My question is this, say that the client that is listed on row 5 closes, I want to be able to delete the data in that row and have the 6th row become the 5th and so forth. Hopefully this can work the other way as well so if I wanted to insert a row. My wife seems to think it can;t be done. My neighbor on the other hand (who is typically right) thinks this can be accomplished.

    Any help is greatly appreciated.

    Thanks
    Kris
    Yes it can be done.


    Right click on the row number then click on delete.

    And you can do the some for the column click on the A col and delete. B -> A

    To add right click then select insert.
    Last edited by ratcat; 03-26-2008 at 09:25 PM.

  3. #3
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    If I understand your problem correctly you want the colurs to be changed when rows are added or deleted

    It can be done with a macro as long as you do not have Macro Security set to high or set a digital certificate for the macro

    This macro will recolour the cells in column A to L from row 2 to the last used row with an entry in column A

    change the colour numbers of the command shown in Red to suit your requirements

    'These instructions pre typed & are worded to cater for the novice programmer
    'To install macro to correct location

    'Copy this macro
    'GoTo Excel
    'Select sheet this is to appy to
    'Right Click on Sheet Name Tab > select View Code
    'Past macro into the Worksheet Module displayed



    Please Login or Register  to view this content.
    Please Read Forum Rules Before Posting
    Wrap VBA code by selecting the code and clicking the # icon or Read This
    How To Cross Post politely

    Top Excel links for beginners to Experts

    If you are pleased with a member's answer then use the Scales icon to rate it
    If my reply has assisted or failed to assist you I welcome your Feedback.

  4. #4
    Registered User
    Join Date
    03-26-2008
    Posts
    3
    This came the closest to what I would like, but for some reason it only went to Column L (I forget to mention that I minimized some columns to separate my data) versus W. Is there anyway that I can send you the file to look at? Sorry to ask, Excel is just not my thing...lol.


    Quote Originally Posted by mudraker
    If I understand your problem correctly you want the colurs to be changed when rows are added or deleted

    It can be done with a macro as long as you do not have Macro Security set to high or set a digital certificate for the macro

    This macro will recolour the cells in column A to L from row 2 to the last used row with an entry in column A

    change the colour numbers of the command shown in Red to suit your requirements

    'These instructions pre typed & are worded to cater for the novice programmer
    'To install macro to correct location

    'Copy this macro
    'GoTo Excel
    'Select sheet this is to appy to
    'Right Click on Sheet Name Tab > select View Code
    'Past macro into the Worksheet Module displayed



    Please Login or Register  to view this content.

  5. #5
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    [COLOR="Blue"]Note:- I forgot to mention the macro will only work if 1 row is added or deleted at a time[/COLOR]



    This line of code says from column A to column L if you can change the l inside the " marks to another column as required

    example changing
    Please Login or Register  to view this content.
    from above to
    Please Login or Register  to view this content.
    will colour cells A to W


    or to colour the entire row replace

    Please Login or Register  to view this content.
    with
    Please Login or Register  to view this content.
    If the above does not do as required then you can post it to this site when you reply.
    To post the file as an attachment to this site it needs to be zipped & less than 100kb. If it is bigger than 100kb then you could upload it to a file sharing site like rapidshare.com & post a link with a reply to this thread.

  6. #6
    Registered User
    Join Date
    03-26-2008
    Posts
    3
    Ugh..so frustrating....lol. I have attached the report. Any help is greatly appreciated.
    Attached Files Attached Files

  7. #7
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    Macro added to the workbook attached to this reply

    Macro will run if single/multiple rows are added/deleted and also
    if the last used row in column A is not the same row number of the last used row in Column C

    Macro removes border & cell colouring formating below the last used row
    Macro adds border if the last used row in column A is not the same row number of the last used row in Column C

    Macro formats from column A to last used column based on headers in row 3. this is currently column W

    Macro can easily be modified to allow for changes to the number colours
    Attached Files Attached Files

+ 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