+ Reply to Thread
Results 1 to 8 of 8

Macro to format inserted rows

  1. #1
    Registered User
    Join Date
    02-25-2009
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    79

    Macro to format inserted rows

    Im not sure this can be done but here goes. I have a Macro "listed Below" that inserts 2 rows between each product i have on my worksheet. What i would like to do is have the inserted rows formated to what i want.

    Number = Text
    Alignment = Left Indent / Center, Text control all unticked
    Font = Arial, Font Style = Bold, Size = 10, Colour = Red

    Is this possible? also the macro im using seems to run slow as there is a lot of data, is their anyway to speed this up?

    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671

    Re: Macro to format inserted rows

    Something like this
    Please Login or Register  to view this content.
    Looking for great solutions but hate waiting?
    Seach this Forum through Google

    www.Google.com
    (e.g. +multiple +IF site:excelforum.com/excel-general/ )

    www.Google.com
    (e.g. +fill +combobox site:excelforum.com/excel-programming/ )

    Ave,
    Ricardo

  3. #3
    Registered User
    Join Date
    02-25-2009
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    79

    Re: Macro to format inserted rows

    That seem to work a treat thanks very much. Is there anyway to speed the process up? i get a not responding and the worksheet crashes, Im not sure if its because there is to much data.

  4. #4
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671

    Re: Macro to format inserted rows

    Put this in front of your For loop:
    Please Login or Register  to view this content.
    and
    Please Login or Register  to view this content.
    after next

  5. #5
    Registered User
    Join Date
    02-25-2009
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    79

    Re: Macro to format inserted rows

    Sorry i have just realised that formula did not do what i needed, it is only inserting 1 row instead of 2 and on some of the rows the left indent is not working, also the word wrapping is still ticked, can this be sorted?

  6. #6
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671

    Re: Macro to format inserted rows

    I do not want to be bold, but I think this is the time you tweak the code yourself. The logic is there and all you need to do is do the next step yourself.

    The macro recorder is a great help in this.

    1) Try to select two rows and right click insert row
    2) Right click to change the word wrapping.

    If you can't get it right, we will help you, but give it a try.

  7. #7
    Registered User
    Join Date
    02-25-2009
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    79

    Re: Macro to format inserted rows

    Hi

    I have been trying this most of the day, i did record the macro and came up with the code below, this does put the gaps where i want them to be but i still can not get the format to do what i want, This is the code i have at the mo

    Please Login or Register  to view this content.
    Last edited by SilverFox; 11-06-2009 at 11:50 AM.

  8. #8
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671

    Re: Macro to format inserted rows

    SilverFox, I've adjusted the code to this:
    Please Login or Register  to view this content.

+ 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