+ Reply to Thread
Results 1 to 6 of 6

Check Headers and stop the next Macro if its different...

  1. #1
    Registered User
    Join Date
    07-28-2013
    Location
    Athens
    MS-Off Ver
    Excel 2010
    Posts
    55

    Smile Check Headers and stop the next Macro if its different...

    Hello, I did not want to bother you again but I have a problem that I can not solve it because my knowledge in vba etc, are limited and could not become to find with Macro Recorder.
    Usually I solve the problems on my own by searching on Google and experimenting with ready Macros and Macro Recorder.


    I have an excel file with a macro and I want before this macro launched, to run another macro that can check if the headers have the correct name and in its correct position. The headers is in first Row.


    If are not in the correct position or if it doesn't exist or if not have the correct name, then the process of the next macro be stopped and of course be informed that there is a problem.

    But if Is everything okay, then proceed to the next macro and be informed that Is everything okay.


    I have attached a Sample file with the headers i'm using.
    Sample...xlsm

    I know it's a difficult thing what I'm asking. I'm not asking necessarily someone to write this for me, i just asking if you have any information that could help me or some combination of ready macros where I could work, you saved my life.


    This is my headers:
    Please Login or Register  to view this content.
    Thanks for your time and apologize for'm a newbie.
    Last edited by lagiosman; 08-11-2013 at 08:37 AM.
    ~Our technology has exceeded our humanity~

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Check Headers and stop the next Macro if its different...

    Where are the headers you want to check for?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    07-28-2013
    Location
    Athens
    MS-Off Ver
    Excel 2010
    Posts
    55

    Re: Check Headers and stop the next Macro if its different...

    in first row. I have included in my post.
    Last edited by lagiosman; 08-11-2013 at 08:38 AM.

  4. #4
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Check Headers and stop the next Macro if its different...

    try it
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    07-28-2013
    Location
    Athens
    MS-Off Ver
    Excel 2010
    Posts
    55

    Re: Check Headers and stop the next Macro if its different...

    Quote Originally Posted by nilem View Post
    try it
    Please Login or Register  to view this content.
    Thank you very match, it's working.

  6. #6
    Registered User
    Join Date
    06-02-2014
    Posts
    11

    Re: Check Headers and stop the next Macro if its different...

    Hi I have the same question except I need mine to cycle through 5 sheets all with the same headers.

    Any help would be greatly appreciated.

    Im thinking a For Each would be appropriate in replacing the With statement you have but Im new to VBA and not too sure.

    Thanks in advance

+ 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. Stop Auto-Formatting Headers in Table Upon Row Insert
    By joshkking in forum Excel General
    Replies: 3
    Last Post: 01-04-2013, 10:52 AM
  2. Macro to check Entire Column Q for 0 and stop macro
    By L2012 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-06-2012, 12:36 PM
  3. Worksheet consolidation, VBA. Stop copying column headers
    By Lifeseeker in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-21-2012, 10:56 AM
  4. Stop Macro, Check Cells & Modify if Necessary, Resume Macro
    By AccountantCost in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-08-2009, 07:39 AM
  5. [SOLVED] How do I stop column headers from being sorted in a row?
    By Sally the newbie in forum Excel General
    Replies: 3
    Last Post: 03-16-2006, 06:38 PM

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