+ Reply to Thread
Results 1 to 2 of 2

VBA help

  1. #1
    Registered User
    Join Date
    04-17-2010
    Location
    Chula Vista, California
    MS-Off Ver
    Excel 2007
    Posts
    8

    VBA help

    I hope I explain this right:
    To keep usage statistics of a variety of databases my company subscribes to, i have a main user form where you enter the month and year then click a button that represents a database. This opens another user form for that database. I enter the info, click submit and the data fills a worksheet for that database, putting the data in the cells of the chosen month and year. Using IF and THEN statements, I can get the first year to work fine, but any subsequent years nothing happens. I'm probably missing something with nesting but can't figure it out. Below is an example of the first two years. The 2011 statements work, but when I choose 2012, the 2011 statement runs again.
    Please Login or Register  to view this content.
    I've tried "Else if", "Or" and "And" but get errors that I can't resolve. I'm no programmer so there may be better ways to write the IF statements like variables or something, but I don't know how to do them. The statements work, so that was good enough.

    Any help would be greatly appreciated.
    Last edited by Leith Ross; 04-17-2010 at 06:01 AM. Reason: Added Code Tags

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: VBA help

    Hello cosber,
    Welcome to the Forum!

    There are some rules you need to be aware of when you post.
    1. Your thread title should clearly describe your problem or question.
    2. To make the code easier to read and copy, format it with Code Tags.

    Because you are new, I have wrapped the code for you. A better title would be "Problem nesting IF...THEN statements".

    As a new member, please take some time to familiarize yourself with the rules.
    Forum Rules
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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