+ Reply to Thread
Results 1 to 5 of 5

macro that creates new sheets for changes in value

  1. #1
    Registered User
    Join Date
    07-03-2012
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    3

    macro that creates new sheets for changes in value

    First post, so please have mercy. I want to create a macro that creates a new sheet each time the value changes in a range. The value that it should key off of is Column G (see attached). I need the new sheets to have all columns (A-R) and headers. It would be great if the sheets would be named for the value in column G but not a necessity. I've tried a number of macros from other posts but trying to tweak them to work for me just hasn't worked with my limited programming skills. Any help would be greatly appreciated. Thanks
    Attached Files Attached Files

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: macro that creates new sheets for changes in value

    Try this code
    Please Login or Register  to view this content.
    Copy the Excel VBA code
    Select the workbook in which you want to store the Excel VBA code
    Hold the Alt key, and press the F11 key, to open the Visual Basic Editor
    Choose Insert | Module
    Where the cursor is flashing, choose Edit | Paste

    To run the Excel VBA code:
    Choose View | Macros
    Select a macro in the list, and click the Run button


    Do let me know if you need a small bit of code that will clear the contents of all your sheets before entering fresh data (specially when you run the macro several times).
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    07-03-2012
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: macro that creates new sheets for changes in value

    This worked great! I'd love to get that "small bit of code" to clear the contents of all sheets. Thanks again!

  4. #4
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: macro that creates new sheets for changes in value

    Add this bit of code before the line With worksheets("worksheet")

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    07-03-2012
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: macro that creates new sheets for changes in value

    Looks good. 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