+ Reply to Thread
Results 1 to 2 of 2

Active - X Command Button

  1. #1
    Registered User
    Join Date
    02-08-2018
    Location
    Jacksonville, FLorida
    MS-Off Ver
    2013
    Posts
    1

    Active - X Command Button

    PHP Code: 
    I am trying to put in an active-X control button with a macro to check a date then change a date.
    below is a basic version of what I am trying to accomplish and I will be able to expand it out once I get the first one solid.

    I have a spread sheet that I track inspections for work on the intervals of 7142856112 and 224.  Obviously the 7 day inspection occurs every 7 calendar days and the 14 every 14 calendar days (twice a month) and so on...
    I have been hard entering all these dates but with the growing amount of gear I have it will be easier to just enter a set of baseline dates that everything is initially due then use the update button for current accuracy on what is due for that week.  
    When the 28 day comes around it will require all inspections up to the 28 day to include the 7 and 14.  All days on the spread sheet should match below that inspection.
    This inspections must be due on Wednesday of each week and show that date
    I have the formulas for A1:A5 right now to just add everything off the 14FEB date and adding 14/28/56/etc...

    I want to be able to hit an "UPDATE" button and have the dates change if < TODAY to update appropriately

    I tried to add a basic button with the formula of =IF(A1 >TODAYA1WEEKDAY(A1+7-4), 0)  This formula does not workSo I was working towards a Active-X button to work for me.

    I was able to write to have the Active-X button throw a pop up window saying "date is before Today" with 
    If (CDate(A1) < TODAYThen 
    MsgBox 
    ("date is before Today")

    I have tried every way to Sunday to get the date to change to 14FEB18 if I have input already say 10JAN18It will not change appropriately.

    I also do not want it to change the dates of the other cells B2:B5 if those dates have yet to pass.  But I think I can put those parameters into the cell vise the VBA button

                  
    A                 B
    ---------------------------------
    1   14-Feb-18             7
    ---------------------------------
    2   21-Feb-18            14
    ---------------------------------
    3   14-Mar-18            28
    ---------------------------------
    4   11-Apr-18            56
    ---------------------------------
    5   6-Jun-18           112
    ---------------------------------
    6   26-Sep-18           224
    ---------------------------------


    Thank you for any help
    [/PHP]

  2. #2
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Active - X Command Button

    Not sure I completely understand the issue, but try this.
    Please Login or Register  to view this content.
    You might have to change the commandbutton number or name. The same code can be used for the other intervals by changing to the '+ 7' to '+ 14', '+ 28', etc.
    Any code provided by me should be tested on a copy or a mock up of your original data before applying it to the original. Some events in VBA cannot be reversed with the undo facility in Excel. If your original post is satisfied, please mark the thread as "Solved". To upload a file, see the banner at top of this page.
    Just when I think I am smart, I learn something new!

+ 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. Is there a way to Right Click an Active-X Command Button?
    By cmore in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-25-2017, 11:27 PM
  2. Question about Command Button (Active X Control)
    By niuyuer in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-17-2015, 08:21 AM
  3. [SOLVED] Active X Command Button not working
    By gassiusmax in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-04-2015, 01:29 PM
  4. Using an Active X Command Button
    By Scottmcq12 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-10-2014, 05:04 AM
  5. [SOLVED] Active Command Button Properties
    By Usethaschwarz in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 08-15-2012, 08:47 AM
  6. Tab sequence from cell to active x button and then to a command button
    By 2funny4words in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-07-2009, 02:27 PM
  7. Printing Active Sheet with command button
    By iturnrocks in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-19-2007, 03:53 AM

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