+ Reply to Thread
Results 1 to 10 of 10

Adding new record, sorting and formatting

  1. #1
    Registered User
    Join Date
    06-21-2010
    Location
    Toronto, Ontario, Canada
    MS-Off Ver
    Excel 2010
    Posts
    47

    Adding new record, sorting and formatting

    Hi there,

    I have a resource data base where I need to added resources for tracking purposes. I have created a userform to add a new record. What I would like to also have this marco do is sort the table by column G after the record has been added and format each cell with a light grey border once the record has been added.

    Thank you for your help.

    The code I have so far is the following:

    Please Login or Register  to view this content.

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

    Re: Addinga new record, sorting and formating

    Hello stait,

    Does column "G" have a header in row 1?
    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!)

  3. #3
    Registered User
    Join Date
    06-21-2010
    Location
    Toronto, Ontario, Canada
    MS-Off Ver
    Excel 2010
    Posts
    47

    Wink Re: Addinga new record, sorting and formating

    Quote Originally Posted by Leith Ross View Post
    Hello stait,

    Does column "G" have a header in row 1?
    Hi there,

    Yes, it is "Full Name" and it is in row 7.

    Thank you again for your help.

    Stephen

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

    Re: Adding new record, sorting and formatting

    Hello Stephen,

    Are the borders for each cell in the table or just for the cells in column "G"?

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

    Re: Adding new record, sorting and formatting

    Hello Stephen,

    This macro will sort the table using column "G". It adds a thin line gray border around each cell in the last row. You may have trouble seeing the borders as this setting is the same as Excel's default gridline color. The line is thicker than the default setting.
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    06-21-2010
    Location
    Toronto, Ontario, Canada
    MS-Off Ver
    Excel 2010
    Posts
    47

    Re: Addinga new record, sorting and formating

    No, there are boarders for the chart....Column A-AP....and for all rows with data. The boarders are: Line Weight - Standard - Grey - 25%

  7. #7
    Registered User
    Join Date
    06-21-2010
    Location
    Toronto, Ontario, Canada
    MS-Off Ver
    Excel 2010
    Posts
    47

    Re: Addinga new record, sorting and formating

    Thank you so much for this. I seem to be having trouble...where in my code would I add this. I have tried a few things and it does not seem to work.

    Thank you again

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

    Re: Adding new record, sorting and formatting

    Hello stait,

    If you post your workbook, I can add it in for you. If you want to do it yourself, here are the directions.

    Adding the Macro
    1. Copy the macro above pressing the keys CTRL+C
    2. Open your workbook
    3. Press the keys ALT+F11 to open the Visual Basic Editor
    4. Press the keys ALT+I to activate the Insert menu
    5. Press M to insert a Standard Module
    6. Paste the code by pressing the keys CTRL+V
    7. Make any custom changes to the macro if needed at this time.
    8. Save the Macro by pressing the keys CTRL+S
    9. Press the keys ALT+Q to exit the Editor, and return to Excel.

    To Run the Macro...
    To run the macro from Excel, open the workbook, and press ALT+F8 to display the Run Macro Dialog. Double Click the macro's name to Run it.

  9. #9
    Registered User
    Join Date
    06-21-2010
    Location
    Toronto, Ontario, Canada
    MS-Off Ver
    Excel 2010
    Posts
    47

    Re: Adding new record, sorting and formatting

    Quote Originally Posted by Leith Ross View Post
    Hello stait,

    If you post your workbook, I can add it in for you. If you want to do it yourself, here are the directions.

    Adding the Macro
    1. Copy the macro above pressing the keys CTRL+C
    2. Open your workbook
    3. Press the keys ALT+F11 to open the Visual Basic Editor
    4. Press the keys ALT+I to activate the Insert menu
    5. Press M to insert a Standard Module
    6. Paste the code by pressing the keys CTRL+V
    7. Make any custom changes to the macro if needed at this time.
    8. Save the Macro by pressing the keys CTRL+S
    9. Press the keys ALT+Q to exit the Editor, and return to Excel.

    To Run the Macro...
    To run the macro from Excel, open the workbook, and press ALT+F8 to display the Run Macro Dialog. Double Click the macro's name to Run it.
    Hi Leith,

    Thank you again for all your help.

    below is the code I am using for adding a record. Right now the record is being added to the first blank row after data. What I want to have is once the data is added, the cells are formated to have a light grey boarder in each cell. I would then like to have the data sorted by column "G" - "Full Name". The columns with data are A - AP.

    Thank you again.

    Stephen

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    06-21-2010
    Location
    Toronto, Ontario, Canada
    MS-Off Ver
    Excel 2010
    Posts
    47

    Turning off filters when closing sheet

    I was wondering if anyone knows a macro which will turn off all filters when you close your Excel Sheet. I have a sheet which is used by many people and I am finding people are using the filters to sort data and when the next person used the sheet, they are always trying to figure out what filter is on.

    Thank you

    Stephen

+ 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