+ Reply to Thread
Results 1 to 2 of 2

VBA code to loop through a range of selected cells, to add to my macro

  1. #1
    Registered User
    Join Date
    11-25-2014
    Location
    England
    MS-Off Ver
    2013
    Posts
    2

    VBA code to loop through a range of selected cells, to add to my macro

    Hi, I am new to VBA and have been struggling with this problem.

    In the attached excel document worksheet 1 is called 'manufacturing bom'

    I have a button called create revision, which is driven by a macro called 'Rev B'

    This macro creates a copy of a new work sheet & names it whatever is in cell 'D5' eg Rev A,

    I would like the value in cell D5 to change every time I press the create revision button, eg Rev A, Rev B, Rev C etc so it automatically creates a new sheet with the next name in the loop, to save me manually changing it each time.

    I cant work out the code for this?

    Hopefully someone can help me with this?

    Thanks

    Craig
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    07-03-2013
    Location
    Montreal, QC
    MS-Off Ver
    Excel 2010
    Posts
    61

    Re: VBA code to loop through a range of selected cells, to add to my macro

    Here is Function that might help you. Just add a line a code to call it form your Create Revision macro.

    What it does it converts the revision letter into ASCII code and increments it by 1 to get to the next letter.

    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)

Similar Threads

  1. Loop backwards through selected range - delete entire row from selected cells
    By scottbass in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-20-2014, 09:21 AM
  2. How to display selected range of cells in Textbox1 using VBA code
    By sreekanth446 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-13-2012, 11:40 PM
  3. Macro to Loop Function throughout selected cells
    By Alvinz in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 09-20-2012, 08:57 AM
  4. Macro code for auto-sorting of a selected range
    By danzing87 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-03-2010, 04:19 AM
  5. Replies: 1
    Last Post: 05-12-2008, 05:53 PM

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