+ Reply to Thread
Results 1 to 7 of 7

Help with IF Statements in VBA

  1. #1
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Help with IF Statements in VBA

    I am sure this is really simple for some of you, I'm still haveing a hard time grasping this.

    Any way, I was trying to get rid of the formulas on the Summaries Tab, and use VBA instead so that the code can't be altered or stepped on for the ARRIVAL and DEPARTURE formulas. I can't figure out how to make an if statement work though. I need it to check a Sheets Value, and then if the Phrase matches, use a set of values from one sheet, if not, use a another Sheets Values. I put the formulas into the sample sheets so you can see what I am talking about easier.

    Also I need help with another problem that may come up, which has already in one instance. But I need help with the Time Log as well, so that if I change the name of the time log, the Sorting Macro will still work? It would be great if this same function was applied to the method above as well just in case the scenario presents itself again.

    Thanks.

    Time Log Example.xlsm

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Help with IF Statements in VBA

    By stepped on you mean people are deleting your formulas?

    Best solution I'd recommend is leave the VBA out. Instead, unlock the cells you want to allow them to edit, then PROTECT the sheet. Now the formula cells can't be edited.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Help with IF Statements in VBA

    Yes, people have a tendancy to delete the formulas, and then others, only GOD knows why feel they need to do things their own way.
    End Result Its just too easy for people to unlock excel, at least with VBA its a little more challenging and may deter people from messing with things they don't need to touch.
    I also already have alot of code I managed to find and piece together to do most of what I want done, I just need help with the IF statements and making them work.
    Last edited by midnightorion; 10-05-2012 at 07:05 PM.

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,615

    Re: Help with IF Statements in VBA

    Except that you then need to put a process in place to force them to enable macros.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  5. #5
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Help with IF Statements in VBA

    They already know to enable the macros as I already have alot of code implemented into the project to make things a little easier for them.

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,615

    Re: Help with IF Statements in VBA

    Please Login or Register  to view this content.
    Not easy enough if they are determined to make changes.

  7. #7
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Help with IF Statements in VBA

    Anyone able to help me with this one?

+ 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