+ Reply to Thread
Results 1 to 10 of 10

Adding action to current macro

  1. #1
    Registered User
    Join Date
    03-18-2010
    Location
    Houston
    MS-Off Ver
    Excel 2007
    Posts
    15

    Question Adding action to current macro

    Below is a macro that is used to delete unnecessary rows, insert a column, and designate a week for two spreadsheets in a workbook:

    Please Login or Register  to view this content.
    I also need to add an action in here that will delete all the periods in the Header names in Row 1. How can this be accomplished? Any help is greatly appreciated.
    Last edited by houseguy007; 03-19-2010 at 12:45 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Adding action to current macro

    Please edit your post to add code tags.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Valued Forum Contributor mdbct's Avatar
    Join Date
    11-11-2005
    Location
    CT
    MS-Off Ver
    2003 & 2007
    Posts
    848

    Re: Adding action to current macro

    houseguy007,

    Edit your post and add the code tags (use the full editor, highlight the code and click on the #)

    I did not see any periods in the workbook you had posted in this thread.

    Adding teylyn's solution from here, change the Selection to specify the range.

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    03-18-2010
    Location
    Houston
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Adding action to current macro

    Sorry about that. I didn't realize the periods were a problem until later.

    I tried to use the Macro but it didn't delete the periods. Would you like me to include a version of the workbook I posted earlier with periods in it?

  5. #5
    Valued Forum Contributor mdbct's Avatar
    Join Date
    11-11-2005
    Location
    CT
    MS-Off Ver
    2003 & 2007
    Posts
    848

    Re: Adding action to current macro

    Yes - please

  6. #6
    Registered User
    Join Date
    03-18-2010
    Location
    Houston
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Adding action to current macro

    Attached is the workbook with periods included in the header row similar to how they appear in the actual document. Thanks again for your help.
    Attached Files Attached Files

  7. #7
    Valued Forum Contributor mdbct's Avatar
    Join Date
    11-11-2005
    Location
    CT
    MS-Off Ver
    2003 & 2007
    Posts
    848

    Re: Adding action to current macro

    If you are referring to the periods in the Metric. # cells the macro as posted will remove them. To make it work with the book you posted, I needed to adjust the macro to delete 6 (instead of 7) rows and to look for the Sheet3 and Sheet13, but beyond that, it will work as posted

  8. #8
    Registered User
    Join Date
    03-18-2010
    Location
    Houston
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Adding action to current macro

    So it worked when you tried it?

    I still can't get it to work for some reason. Are there any formatting issues that might cause the macro not to recognize a period?

  9. #9
    Valued Forum Contributor mdbct's Avatar
    Join Date
    11-11-2005
    Location
    CT
    MS-Off Ver
    2003 & 2007
    Posts
    848

    Re: Adding action to current macro

    Ahh crum! - I did it again (or didn't do it).

    I forgot to make specify the sheet that the Find Replace is to be used on. I had Sheet3 as the active sheet, so when the macro ran, it removed the period from that sheet (twice).

    Try this one. (change the sheet names to match your set up and the rows to be deleted (you had asked for 1 through 6, but the macro you posted earlier is showing 1 through 7.)

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    03-18-2010
    Location
    Houston
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Adding action to current macro

    YES! It worked! Thanks!

+ 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