Results 1 to 8 of 8

Code won't call calendar

Threaded View

  1. #1
    Forum Contributor
    Join Date
    03-05-2009
    Location
    usa
    MS-Off Ver
    Excel 2016 32Bit
    Posts
    1,173

    Code won't call calendar

    Code does not call calendar when option button is checked.If option button is checked and H11 has no data it calls calendar to insert date. This form has two dates that are controlled by what button is selected.If I select optionbutton 2 its does not call call calendar like it does with option bitton one.?? Here is what I have now,option button1 is always first,but if I do it backwards and use button 2 it works?


    This is part of a larger code running

     If Range("H11").Text = "" Then
            testtwoday.Show
        Cancel = True
        Unload Me
            End If
    
      If Range("H11").Text = "" Then
            testtwoday.Show
        Cancel = True
        Unload Me
            End If
    
    If Sheets("Two Day").OptionButton1.Value = True And ActiveSheet.Range("H11") = "" Then
    Call MsgBox(" Install the Rough Date?", vbCritical + vbOKOnly)
    Cancel = True
    
         Exit Sub
       End If
      
       If Sheets("Two Day").OptionButton2.Value = True And ActiveSheet.Range("H12") = "" Then
       
    Call MsgBox(" Install the Finish Date?", vbCritical + vbOKOnly)
    Cancel = True
    Exit Sub
    End If

    Private Sub CommandButton2_Click()
    If Sheets("Two Day").OptionButton1.Value = True And ActiveSheet.Range("H11") = "" Then
     Range("H11").Select
        Cancel = True
        Unload Me
         
    End If
    
    If Sheets("Two Day").OptionButton2.Value = True And ActiveSheet.Range("H12") = "" Then
     Range("H12").Select
        Cancel = True
        Unload Me
         
    End If
    
    End Sub
    Last edited by zplugger; 01-14-2017 at 08:34 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] VBA code appears to call a another code but it doesn't actually run
    By cinstanl in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-15-2016, 09:09 AM
  2. VBA code to API call
    By ErgoTeam in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-25-2016, 08:36 AM
  3. Calendar for On Call Rota Problem
    By doppers in forum Excel General
    Replies: 1
    Last Post: 06-07-2011, 07:55 AM
  4. how can i call sub or function in vba code
    By xxx in forum Excel General
    Replies: 3
    Last Post: 06-28-2006, 06:50 AM
  5. call code for all sheets
    By rwnelson in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-03-2006, 07:25 PM
  6. [SOLVED] Code in one workbook to call code in another XL file
    By phil.latio@lycos.co.uk in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-01-2005, 11:05 AM
  7. call up a calendar
    By icebreaker914 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-29-2005, 11:06 PM

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