+ Reply to Thread
Results 1 to 6 of 6

VBA how to run code on sections < 2

  1. #1
    Registered User
    Join Date
    01-19-2014
    Location
    United Kingdom
    MS-Off Ver
    Excel 2003
    Posts
    25

    VBA how to run code on sections < 2

    I am doing some coding for a template, but the code needs to be ran in certain sections, or after a certain section.

    As i can count the sections, but i cant get the code to run based on it?

    Like, if i try to run "if count > 2" it will run the code based on if count is greater than 2, which it is that is not what i am after
    I want something like

    For each Section > 2
    code
    code
    code
    next

  2. #2
    Forum Contributor
    Join Date
    12-14-2013
    Location
    Tilburg, Nederland
    MS-Off Ver
    Excel 2010
    Posts
    256

    Re: VBA how to run code on sections < 2

    It's not completely clear for me what you mean with the sections...

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    01-19-2014
    Location
    United Kingdom
    MS-Off Ver
    Excel 2003
    Posts
    25

    Re: VBA how to run code on sections < 2

    Well i need to play the code AFTER a section.

    The code will be automatic, and not rely on "selections"

    remember its "SECTION" not sELection

    I thought that if i counted how many sections there is (maybe there is a built in function for this, but i dont know)

    then i can run code after section 2 or somthing, but if there is ANYway, that is all i am looknig for

  4. #4
    Forum Contributor
    Join Date
    12-14-2013
    Location
    Tilburg, Nederland
    MS-Off Ver
    Excel 2010
    Posts
    256

    Re: VBA how to run code on sections < 2

    I don't know what you mean with the sections. I can only think of several named ranges or something like that.
    Maybe it easier to provide an workbook example and explain the section(s)

  5. #5
    Registered User
    Join Date
    01-19-2014
    Location
    United Kingdom
    MS-Off Ver
    Excel 2003
    Posts
    25

    Re: VBA how to run code on sections < 2

    Basically, the macro formats the pictures to the specified width / height.

    But i don't want to run the macro on section 1 (which is also page 1)
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    12-14-2013
    Location
    Tilburg, Nederland
    MS-Off Ver
    Excel 2010
    Posts
    256

    Re: VBA how to run code on sections < 2

    Oh I see it's a Word docm, I'm a noob on word.... sorry.
    May some one else can be of assistance.

+ 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. Replies: 0
    Last Post: 12-20-2011, 06:15 PM
  2. Sections?
    By Curalice in forum Excel General
    Replies: 0
    Last Post: 03-24-2008, 02:20 PM
  3. VBA Code to extract and save sections of worksheet to seperate files
    By Zyphon in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-17-2007, 10:57 AM
  4. [SOLVED] Background Color Code Sections
    By JJ in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 12-03-2005, 12:00 AM
  5. [SOLVED] Skipping sections of code
    By ExcelMonkey in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-16-2005, 09:06 AM

Tags for this Thread

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